openhab-linuxpkg
openhab-linuxpkg copied to clipboard
debian postinst script removes config file /etc/init.d/openhab
The postinst script handles the system startup procedure: if systemd is present, /etc/init.d/openhab is removed.
This is a bug for several reasons: a) if a system reverts from systemd to sysv strartup openhab will not automatically be started because you deleted the startup file b) debsums reports the missing config file which is very annoying (I execute debsums daily in a cron-job to check for such missing files and receive this error daily until I manually fix it c) This behaviour is forbidden by the debian policy (see section 10.7.3 about behaviour with configuration files and section 6.2. about maintainer scripts idempotency).
proposed solution: just leave /etc/init.d/openhab in place even on a systemd (why do you remove it in the first place?)
did you use the debhelper scripts to create the package? See also:
- https://wiki.debian.org/Teams/pkg-systemd/Packaging
- https://manpages.debian.org/testing/debhelper/dh_installsystemd.1.en.html
- https://manpages.debian.org/testing/debhelper/dh_installsystemd.1.en.html
Hi @tom-ch1, thanks for the report.
It was originally left in place, the decision to remove was to fix the behaviour described in https://github.com/openhab/openhab-linuxpkg/issues/158
The fix in #158 is a violation of the debian policy. In debian, every server package solves this problem (I think it's all described in the linkes I provided above). I therefore suspect that there should be a different way to fix #158 without producing this bug here.