openhab / openhab-linuxpkg

Repo for Linux packages
Eclipse Public License 2.0
18 stars 33 forks source link

debian postinst script removes config file /etc/init.d/openhab #225

Open tom-ch1 opened 8 months ago

tom-ch1 commented 8 months ago

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?)

tom-ch1 commented 8 months ago

did you use the debhelper scripts to create the package? See also:

BClark09 commented 7 months ago

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

tom-ch1 commented 7 months ago

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.