openhab / openhab-linuxpkg

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

systemctl enable openhab2 fails on FedoraServer 31 #158

Closed dwrobel closed 4 years ago

dwrobel commented 4 years ago

Enabling openhab2 on a fresh installation of FedoraServer 31 fails as follows:

# systemctl enable openhab2
Synchronizing state of openhab2.service with SysV service script with /usr/lib/systemd/systemd-sysv-install.
Executing: /usr/lib/systemd/systemd-sysv-install enable openhab2
Failed to execute /usr/lib/systemd/systemd-sysv-install: No such file or directory

As a workaround one could add chkconfig package:

# dnf provides /usr/lib/systemd/systemd-sysv-install
chkconfig-1.11-5.fc31.armv7hl : A system tool for maintaining the /etc/rc*.d hierarchy
Repo        : fedora
Matched from:
Filename    : /usr/lib/systemd/systemd-sysv-install

However, I would be nice not to depend on that compatibility layer.

BClark09 commented 4 years ago

Thanks for flagging this up. I'll have a look to see what's causing it.

It should not need to depend on the compatability layer. It looks like it's finding the scripts in init.d before it finds the service file.

Does using systemctl enable openhab2.service (without chkconfig) behave any differently?

BClark09 commented 4 years ago

Does using systemctl enable openhab2.service (without chkconfig) behave any differently?

It does not. I can confirm that the issue is resolved if you delete /etc/init.d/openhab2. So this issue is related to https://github.com/openhab/openhab-linuxpkg/issues/134 and we should do this automatically if systemd is present.