Add service file

This commit is contained in:
Simon Stürz 2018-03-12 16:38:31 +01:00
parent e0ca87ef39
commit 9d5ab1bf0a
6 changed files with 25 additions and 4 deletions

1
debian/control vendored
View File

@ -4,6 +4,7 @@ Priority: optional
Maintainer: Simon Stürz <simon.stuerz@guh.io>
Build-Depends: debhelper (>= 9.0.0),
dpkg-dev (>= 1.16.1~),
dh-systemd,
qt5-default,
qtbase5-dev,
qtconnectivity5-dev

View File

@ -1 +1,2 @@
usr/bin/
lib/systemd/system/

View File

@ -1 +1,2 @@
usr/bin/nymea-networkmanager
nymea-networkmanager.service /lib/systemd/system/

2
debian/rules vendored
View File

@ -9,7 +9,7 @@ $(PREPROCESS_FILES:.in=): %: %.in
sed 's,/@DEB_HOST_MULTIARCH@,$(DEB_HOST_MULTIARCH:%=/%),g' $< > $@
%:
dh $@ --buildsystem=qmake --parallel
dh $@ --buildsystem=qmake --parallel --with systemd
override_dh_install: $(PREPROCESS_FILES:.in=)
dh_install

View File

@ -0,0 +1,15 @@
[Unit]
Description=Daemon for nymea to configure wifi network using Bluetooth LE.
Documentation=https://github.com/guh/nymea-networkmanager
After=network.target
[Service]
ExecStart=/usr/bin/nymea-networkmanager -d
StandardOutput=journal
StandardError=journal
Restart=on-failure
Type=simple
[Install]
WantedBy=multi-user.target

View File

@ -76,14 +76,17 @@ Core::Core(QObject *parent) :
Core::~Core()
{
qCDebug(dcApplication()) << "Shutting down nymea service";
delete m_nymeaService;
m_nymeaService = nullptr;
delete m_networkManager;
m_networkManager = nullptr;
qCDebug(dcApplication()) << "Shutting down bluetooth service";
delete m_bluetoothServer;
m_bluetoothServer = nullptr;
qCDebug(dcApplication()) << "Shutting down network-manager service";
delete m_networkManager;
m_networkManager = nullptr;
}
void Core::evaluateNetworkManagerState(const NetworkManager::NetworkManagerState &state)