Something I did yesterday broke openhab running as a service.
I rebooted my Rpi this AM and openhab wasn’t running and would no longer start with:
pi@rpiopenhab:~ $ sudo systemctl start openhab -l
Job for openhab.service failed. See 'systemctl status openhab.service' and 'journalctl -xn' for details.
pi@rpiopenhab:~ $ sudo systemctl status openhab.service
● openhab.service - Starts and stops the openHAB Home Automation Bus
Loaded: loaded (/usr/lib/systemd/system/openhab.service; enabled)
Active: failed (Result: exit-code) since Sat 2016-02-06 09:20:05 CST; 8s ago
Process: 4717 ExecStartPre=/usr/share/openhab/bin/setpermissions.sh (code=exited, status=203/EXEC)
Feb 06 09:20:05 rpiopenhab systemd: openhab.service: control process exited, code=exited status=203
Feb 06 09:20:05 rpiopenhab systemd: Failed to start Starts and stops the openHAB Home Automation Bus.
Feb 06 09:20:05 rpiopenhab systemd: Unit openhab.service entered failed state.
Prior to yesterday I was running 1.8 but having problems with MQTT and my GUI wasn’t working - which were fixed yesterday when I upgraded to 1.8.1.
How I was running openhab as a service after that yesterday I don’t know - maybe I did something else later that I can’t recall.
I now figured out that I can run openhab manually using:
I want to run as a service again and am suspecting a permissions thing but tried the following with no joy:
Yes, setpermissions.sh exists, is executable by Anyone and it DOES run if I run:
(openhab.sh calls setpermissions.sh)
[edit: I later found my above statement to be incorrect and that openhab.sh does not call setpermissions.sh]
[so the following where I thought the difference was just the user is probably not correct]
So I suspect the service (however that is configured) runs openhab.sh with user openhab (or something other than root) and something in the setpermissions.sh script (like lots of chown and chmod calls) are not allowed by that services user.
So maybe I somehow changed the rights of a file (or a directory) so that openhab no longer has rights but know of chown openhab:openhab on everything I can think of.
You got me thinking - I am going to walk through all the directories and ownership again…