systemctl enable works without errors - but while executing the systemctl start command I’m getting the following error: Failed to start openhab.service: Unknown unit: openhab.service
If this does not help, what is the output of ls -l /lib/systemd/system/ ? Are there differences in mod/owner:group between other services and openhab.service?
systemctl list-unit-files should show up a long list of services and openhab.service should appear in this list.
We’ve had this topic a few times… it seems like the installer does not work for arm devices. i.e. the pi. find my thread, kai mentioned the link to a way how to self-write a init.d script instead.
Well, imho it would be worth to evaluate, why systemd isn’t working properly in this case. Regarding my own devices all hitches with systemd I saw turned out to be typos or insufficient user rights
@mm1804 please show output of ls -l /etc/systemd/system/multi-user.target.wants/
[Unit]
Description=Starts and stops the openHAB Home Automation Bus
Documentation=http://www.openhab.org
Wants=network-online.target
After=network-online.target
Jumping in on that thread, because I’m trying to get OH2 started as a service on my raspi, however I’m failing.
I created the file “openhab.service” in /lib/systemd/system/ as discribed in Github-link .
I did the “systemctl enable openhab.service” followed by “systemctl start openhab.service”.
However I can’t connect to it using any UI.
The oberservation I got is that for each “systemctl status openhab.service” to printout states a “(running) since …xs ago”. As if it was start just with this command?
I’m lost!
[code]/etc/init.d $ sudo systemctl status openhab
● openhab.service - Starts and stops the openHAB Home Automation Bus
Loaded: loaded (/lib/systemd/system/openhab.service; disabled)
Active: active (running) since Fri 2016-04-08 22:12:35 CEST; 3s ago
Docs: http://www.openhab.org
Main PID: 20320 (java)
CGroup: /system.slice/openhab.service
└─20320 /usr/bin/java -Dopenhab.home=/opt/openhab2 -Dopenhab.conf=/opt/openhab2/conf -Dopenhab.runtime…
Apr 08 22:12:35 OpusPi systemd[1]: Starting Starts and stops the openHAB Home Automation Bus…
Apr 08 22:12:35 OpusPi systemd[1]: Started Starts and stops the openHAB Home Automation Bus.
Apr 08 22:12:35 OpusPi start.sh[20320]: Launching the openHAB runtime… [/code]
I do habe some services pointing to /dev/null … Don’t have any idea if that normal or something is broken by moving the hole system from SD to USB. But since doing that, everything works absolut finde. So maybe that normal?!
openhab.service looking finde. But there are a lot services masked. Also the killprocs.service masked is. Maybe thats something to do with my problem that i can’t kill the openhab.service?
Got myself some help from @DennisausBremen.
I changed the location of the file “openhab.service” from:
"/lib/systemd/system/" to
"/usr/lib/systemd/system/"
AND did use “root” as user.
It is working now (GUIs are connecting, Starting a Systemstart).
Did I misunderstand the description on Github ?