Start script for OH2

I’ve updated the post and am in the process of updating the PR to reflect that the script needs to be in the /lib/systemd/system folder.

@SuperOok could you look over the PR again and see if you feel it’s accurate now?

looks good, thanks

I need to run openhab:install-service in an install script for a docker. At the minute you have to “docker exec blah blah blah bash” in, run /opt/openhab/start.sh, install-service, logout etc… and then everything will work, but I’d like it to do this in the install script.

Any ideas how to run that command without user input?
Thanks
Christian

Failed to get D-Bus connection: No connection to service manager.
pi@raspberrypi:~$ sudo systemctl start openhab.service
Failed to get D-Bus connection: No connection to service manager.
pi@raspberrypi:~$ sudo systemctl enable openhab
Operation failed: Invalid argument
pi@raspberrypi:~$
pi@raspberrypi:~$ sudo systemctl enable openhab.service
pi@raspberrypi:~$

The systemctl enable seams to work, no error. But the start and status gives this error " Failed to get D-Bus connection: No connection to service manager"

What to do ?

sudo systemctl start (stop)(restart) openhab

no (.service)

Yes same error msg

unfortunately i have no other answer, beyond my knowledge, sorry.

On my installation, I had to use the right spelling:
Systemctl enable (path to file)**openHAB.**service
And then I can do a systemctl start openHAB.

I’m running OH2 on Windows 10. When my system reboots, the system automatically runs the start.bat file.

However, I run into the issue described on (http://stackoverflow.com/questions/37671889/apache-karaf-root-instance-already-running) where Karaf can’t start up because the item.0.pid value in instances.properties is set to a non-zero value.

I’ve never played with .bat files. Is there an easy way to delete the instances.properties file before start karaf.bat? Will this break anything?