openHAB AutoRestart Stopped Working

I have recently updated to openhab 1.8.1 and unable to start the service by using sudo /etc/init.d/openhab start
Its returning:
[…] Starting openhab (via systemctl): openhab.serviceJob for openhab.service failed. See ‘systemctl status openhab.service’ and ‘journalctl -xn’ for details.failed!

This is the output of 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 Mon 2016-03-07 11:52:47 UTC; 5min ago
Docs: http://www.openhab.org
Process: 4844 ExecStartPre=/usr/share/openhab/bin/setpermissions.sh (code=exited, status=200/CHDIR)

I think the issue is with the setpermission.sh being not found as there is no openhab directory in /usr/share
I have no idea why its trying to look into that directory.

Please help me in resolving this issueopenhab.serviceJob for openhab.service failed.


How did you install openHAB - I guess your platform is RaspberryPI? :wink: B? B+? 2?
What flavor of OS do you use? Raspbian? Is it up-to-date?
How did you update?

Thanks for the reply and i forgot to mention the details so here they are:
How did you install openHAB
I installed it manually unlike the apt-get method
For that, I followed http://www.instructables.com/id/OpenHAB-on-Raspberry-Pi/
I am using RaspberryPi 2
What flavor of OS do you use? Raspbian? Is it up-to-date?
Using Raspbain and yes its un-to-date
How did you update?
Updated raspberry pi using apt-get update and apt-get upgrade
After this when i rebooted openHAB stopped running. Although, i tried running it using start_debug.sh and it worked perfectly.
So the only thing stopped working was the auto run script.
Earlier i was using openHAB 1.8 so i thought of updating it to openHAB 1.8.1. I followed the same procedure as i did for version 1.8 and replaced my configurations and settings from the older version into the new one. Still no luck.
Running manually still works fine but auto start on reboot is giving me problems.

So you did no update for openHAB at all, because you didn’t install it with apt-get at first.

If there is no really good reason for manual installation, I strongly recommend to uninstall openhab completely and to reinstall with apt-get. This will ensure you have the correct autostart scripts (systemd, not init with up-to-date raspbian)

The Configurations and user data are stored the debian way, so the paths differ a little bit, but the configuration itself will work seamless on the new installation.

Thanks and i really appreciate for the suggestion.
Do i really need to uninstall the pervious installation as its hardly gonna affect the apt-get installation because that is totally independent right?
All i need to do is remove the autostart script and clear the defaults from rc.local
Will that affect the installation?

No, there is no real need, but it would be the clean way to deinstall first.

@Udo_Hartmann So, finally i got that working. I installed using apt-get method.
But now i am facing this issue related to gpio binding. Its not working anymore. I followed all the steps mentioned here https://github.com/openhab/openhab/wiki/GPIO-Binding

I have installed OpenHAB ver 1.8.1 and the add-on’s are also installed correctly.

However, when i am using a switch to toggle the gpio pin its not actually turning the led on. Although when i read the output of the gpio pin, It toggles correctly. So, i tried using a simple python script to toggle the same gpio pin and it worked.

I don’t know what am i doing wrong in here. Any idea?

What’s the gpio related stuff in openHAB? (items, rules)
Do you see input from gpio in openHAB?
How is the configuration for gpio? (openhab.cfg)

items only

yes i do see input from gpio in openHAB and the events.log is also updating.

This has been taking a lot of time, so i finally decided to do a fresh install and everything is working fine. Maybe i messed up somewhere earlier.

Thanks