From 5bc17cfbe1c88460a20b749d3dc87d72075f6d13 Mon Sep 17 00:00:00 2001 From: hjr <> Date: Mon, 25 Dec 2017 16:36:50 +0000 Subject: [PATCH] DEBIAN-triggers: Switched .deb package triggers from sysv to systemd. git-svn-id: https://svn.fhem.de/fhem/trunk@15687 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/DEBIAN/postinst | 14 +++++--------- fhem/contrib/DEBIAN/postrm | 4 ++-- fhem/contrib/DEBIAN/prerm | 6 ++---- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/fhem/contrib/DEBIAN/postinst b/fhem/contrib/DEBIAN/postinst index 523ed27b3..13aaa5434 100644 --- a/fhem/contrib/DEBIAN/postinst +++ b/fhem/contrib/DEBIAN/postinst @@ -15,15 +15,11 @@ chown -R fhem:dialout /opt/fhem # remove repository entry after first installation sed -i /debian.fhem.de/d /etc/apt/sources.list -# set up of autostart -# Sysvinit; upstart no longer supported +# set up of autostart (Sysvinit upstart no longer supported) +ln -s /opt/fhem/contrib/init-scripts/fhem.service /etc/systemd/system/. +systemctl enable fhem -#mkdir -p /etc/init.d -cp /opt/fhem/contrib/init-scripts/fhem.3 /etc/init.d/fhem -chmod ugo+x /etc/init.d/fhem -update-rc.d fhem defaults +# and start the fhem service +systemctl start fhem -if test -f /etc/init.d/fhem; then - /etc/init.d/fhem start noaptmark -fi exit 0 diff --git a/fhem/contrib/DEBIAN/postrm b/fhem/contrib/DEBIAN/postrm index 957d4a3bf..6d0757acf 100755 --- a/fhem/contrib/DEBIAN/postrm +++ b/fhem/contrib/DEBIAN/postrm @@ -12,6 +12,6 @@ if test -f /etc/init/fhem.conf; then rm /etc/init/fhem.conf fi -if test -f /etc/init.d/fhem; then - rm /etc/init.d/fhem +if test -f /etc/systemd/system/fhem.service; then + rm /etc/systemd/system/fhem.service fi diff --git a/fhem/contrib/DEBIAN/prerm b/fhem/contrib/DEBIAN/prerm index d5ca1da36..31cace371 100755 --- a/fhem/contrib/DEBIAN/prerm +++ b/fhem/contrib/DEBIAN/prerm @@ -6,9 +6,7 @@ set -e apt-mark unhold fhem # stop fhem if running -if test -f /etc/init.d/fhem; then - /etc/init.d/fhem stop noaptmark -fi +systemctl stop fhem # remove fhem autostart -update-rc.d -f fhem remove +systemctl disble fhem