diff --git a/fhem/contrib/DEBIAN/postinst b/fhem/contrib/DEBIAN/postinst index b9eaeb347..1360611a5 100644 --- a/fhem/contrib/DEBIAN/postinst +++ b/fhem/contrib/DEBIAN/postinst @@ -9,6 +9,13 @@ fi chown -R fhem:root /opt/fhem +# prevent package fhem from being +# upgraded by apt-get upgrade + +apt-mark hold fhem +echo "fhem hold" | dpkg --set-selections + + # set up of autostart # Sysvinit; upstart no longer supported diff --git a/fhem/contrib/DEBIAN/postrm b/fhem/contrib/DEBIAN/postrm index dbc380760..6d4235c52 100755 --- a/fhem/contrib/DEBIAN/postrm +++ b/fhem/contrib/DEBIAN/postrm @@ -10,11 +10,7 @@ fi if test -f /etc/init/fhem.conf; then rm /etc/init/fhem.conf fi + if test -f /etc/init.d/fhem; then - update-rc.d fhem remove rm /etc/init.d/fhem fi - -if test ! -x /sbin/initctl; then - update-rc.d -f fhem remove -fi diff --git a/fhem/contrib/DEBIAN/prerm b/fhem/contrib/DEBIAN/prerm index b86f7bb52..b98f12a27 100755 --- a/fhem/contrib/DEBIAN/prerm +++ b/fhem/contrib/DEBIAN/prerm @@ -2,10 +2,8 @@ set -e -if pgrep fhem.pl >/dev/null; then - if test -x /sbin/initctl; then - initctl stop fhem - else - invoke-rc.d fhem stop - fi -fi +# stop fhem if running +invoke-rc.d fhem stop + +# remove fhem autostart +update-rc.d fhem remove