mirror of https://github.com/nymea/nymea.git
Change upgrade restart logic to also work on plugins and libs
parent
432ca3f883
commit
8ec5b4f464
|
|
@ -0,0 +1,7 @@
|
|||
# nymea hook to restart nymead after upgrades that change nymea plugins or libraries
|
||||
|
||||
DPkg::Pre-Install-Pkgs {"/usr/libexec/nymea-upgrade-helper"; };
|
||||
DPkg::Tools::Options::/usr/libexec/nymea-upgrade-helper::Version "1";
|
||||
|
||||
DPkg::Post-Invoke {"if [ -e /tmp/nymea-restart-pending ]; then systemctl restart nymead; rm /tmp/nymea-restart-pending; fi"; };
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
#!/bin/sh
|
||||
|
||||
if grep -q nymea
|
||||
then
|
||||
systemctl status nymead > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "A nymea package will be changed. Scheduling nymead restart after upgrade."
|
||||
touch /tmp/nymea-restart-pending
|
||||
fi
|
||||
fi
|
||||
|
|
@ -5,3 +5,5 @@ usr/lib/@DEB_HOST_MULTIARCH@/libnymea-core.so.1.0.0
|
|||
data/systemd/nymead.service /lib/systemd/system/
|
||||
data/logrotate/nymead /etc/logrotate.d/
|
||||
data/dbus-1/io.guh.nymead.conf /etc/dbus-1/system.d/
|
||||
data/dpkg/apt.conf.d/99nymea /etc/apt/apt.conf.d/
|
||||
data/dpkg/nymea-upgrade-helper /usr/libexec/
|
||||
|
|
|
|||
|
|
@ -29,18 +29,6 @@ else
|
|||
echo "Failed to set raw socket network capabilities for nymead. Network device discovery will not be available for non root users."
|
||||
fi
|
||||
|
||||
# Restart the nymea daemon after update if it's running
|
||||
systemctl daemon-reload
|
||||
systemctl status nymead > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
systemctl restart nymead
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Successfully restarted nymea daemon."
|
||||
else
|
||||
echo "FAILED to restart nymea daemon."
|
||||
fi
|
||||
fi
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
|
|
|||
Loading…
Reference in New Issue