diff --git a/fhem/contrib/DEBIAN/postinst b/fhem/contrib/DEBIAN/postinst index e992d92a7..438413a4a 100644 --- a/fhem/contrib/DEBIAN/postinst +++ b/fhem/contrib/DEBIAN/postinst @@ -19,7 +19,7 @@ sed -i /debian.fhem.de/d /etc/apt/sources.list # upstart: not supported # detect init system -test=$(stat /sbin/init |grep "File") +test=$(stat /sbin/init |grep "/sbin/init") re="systemd$" if [[ $test =~ $re ]]; diff --git a/fhem/contrib/DEBIAN/prerm b/fhem/contrib/DEBIAN/prerm index 896c80ef2..862bd3448 100644 --- a/fhem/contrib/DEBIAN/prerm +++ b/fhem/contrib/DEBIAN/prerm @@ -4,7 +4,7 @@ set -e # detect init system -test=$(stat /sbin/init |grep "File") +test=$(stat /sbin/init |grep "/sbin/init") re="systemd$" if [[ $test =~ $re ]]; then diff --git a/fhem/contrib/init-scripts/fhem.service b/fhem/contrib/init-scripts/fhem.service index 375e4e76c..439880da5 100644 --- a/fhem/contrib/init-scripts/fhem.service +++ b/fhem/contrib/init-scripts/fhem.service @@ -13,8 +13,11 @@ WorkingDirectory=/opt/fhem ExecStart=/usr/bin/perl fhem.pl fhem.cfg #ExecStart=/usr/bin/perl fhem.pl configDB # uncomment next two lines if auto-restart desired -#Restart=always -#RestartSec=5 + +# please select restart options according your needs +# Restart=on-abnormal # uncomment for crash and watchdog event recovery only (keeps shutdown working) +# Restart=always # alternativly uncomment this line for recover always +# RestartSec=5 # uncomment always if restart required! [Install] WantedBy=multi-user.target