I just installed a Raspberry Pi with the latest version of openHABian & openHAB 2.4.0. and it works fine.
It seems by default the openHAB instance does not start automatically during the boot process. This post led me here. So /etc/init.d/openhab2 was already there. I just added the two lines below to boot routine by using sudo nano /etc/rc.local
# start openhab /etc/init.d/openhab2 start
When I reboot the Pi openHAB still does not come up. What am I missing here?
Thanks for clarification. I tried to do so, but when I reboot openHAB still does not come up. When I check the process with sudo systemctl status openhab2 It looks like this:
Do I need to fix the mentioned permission issue? If yes, how? Mar 06 21:32:54 openHABianPi karaf[401]: Caused by: java.lang.RuntimeException: Karaf can’t startup, make sure the log file can be accessed and written by the user starting Karaf : /var/lib/openhab2/tmp/lock (Permission denied)
The lock file could be from an old startup that wasn’t cleaned up properly, you could rename (move the file into the same dir with a different name) and try restarting openhab and verify if the log reports the same errors.
When I start openHAB with openhab-cli start it works fine (as long as the service is not running yet with systemd), but it goes done as soon as I close the terminal session.
After finishing & reboot the process looks like this (As recommended to me by @rlkoshak above I used sudo systemctl enable openhab2 to make sure the process will be started during boot process):
Yep, starting openhab as root leaves a bunch of root-owned files around.
I find I rarely have to do anything as root on my OH machine; I log in as the OH user and do the things I need to do, and if root is needed I’ll use sudo for that command. Keeps me from accidentally leaving a bunch of files around that OH won’t be able to manage when it runs normally.
i have same issues here. my openhab wont start… never had that.
i just stopped OH and “openhab-cli clean-cache”, wanted to get Homekit back. now nothing works…