So for me everything looks fine. But no autostart.
/etc/init.d/openhab status ● openhab.service - Starts and stops the openHAB Home Automation Bus Loaded: loaded (/usr/lib/systemd/system/openhab.service; disabled) Active: inactive (dead) Docs: http://www.openhab.org
Maybe some service that needs to be up and running BEFORE openHAB starts is delayed. I would look at order of services startup. Like /var/log/boot created by bootlogd…
I meant /var/log/boot.log to show services on starup:
[ OK ] Started irqbalance daemon. Starting RPC bind service... Starting Network Time Service... Starting Preprocess NFS configuration... Starting GSSAPI Proxy Daemon... Starting Open Home Automation Bus... Starting Login Service... Starting D-Bus System Message Bus... [ OK ] Started D-Bus System Message Bus.
It is not a standard on Rpi, you need bootlogd if I am not mistaken. See here.
Or modify the start part of the openhab starting/stopping script to log something to learn if it gets invoked.
The hint with bootlogd helped me to find the “bug”
So bootlogd only logged (Nothing has been logged yet.) so i started to find out why.
and tadaaaaa … SystemD is my new friend
I don’t know why, but somehow with a update my Raspian switched to SystemD and i didn’t regcognized.
OMG.
I observed the same problem, checked all settings and followed your advice “sudo systemctl enable openhab.service”.
It did result in starting openhab after restart, HOWEVER it can’t be reached by a GUI. The AndroidAPP tells the items-file is empty, the browser tells the Sitemap is empty.
I am lost!
Sure? NO. I checked service, it was reported running.
Like:
pi@OpusPi ~ $ service openhab status
● openhab.service - Starts and stops the openHAB Home Automation Bus
Loaded: loaded (/usr/lib/systemd/system/openhab.service; enabled)
Active: active (running) since Sun 2016-03-20 11:05:24 CET; 31s ago
Docs: http://www.openhab.org
Process: 483 ExecStartPre=/usr/share/openhab/bin/setpermissions.sh (code=exited, status=0/SUCCESS)
Main PID: 1309 (openhab.sh)
CGroup: /system.slice/openhab.service
├─1309 /bin/sh /usr/share/openhab/bin/openhab.sh -o
└─1323 /usr/bin/java -Dlogback.configurationFile=/etc/openhab/logb...
My SetUp was using a manual installation (all in opt/openhab). However I did try to get the apt-get installation, which should be started manually and automatically using the same files (???, that’S what I understand from GitHub-Link). However that didn’t work (at least not the autostart part).
When using the “sudo systemctl enable openhab.service” the following is happening:
The “normal” logs in opt/openhab…are empty, instead I’m getting log-entries in var/log/openhab. It seems that openhab is started now automatically, however from a different location AND without my settings.
So I need to find the correct spot where mysettings should go.
OK, I found the correct spot as stated in the above GitHUB-Link (settings in: etc/openhab/configurations andAddons in :usr/share/openhab/addons).
Openhab starts with systemstart now. However the “old” way to start and stop while the system vis running is broken now. I assume that is because the script “openhab.conf” in still points to the old location of the source files. But where are they now for the apt-get installation?