[Solved] Upstart script .conf for Openhab2?

Hello, I have a manual install of Openhab2 (2.0.0b4 #560) on Ubuntu 14.04 LTS x64 as per http://docs.openhab.org/installation/linux.html

This Ubuntu version uses Upstart to manage startup items. The example sysvinit and systemd therefore do not work.

Does anyone have an Upstart script for Openhab2 that I could look at please?
I start from the user console using this command below at present, but would like it to start boot/as a service.

execute as restricted user openhab:

sudo su -s /bin/bash -c ‘/opt/openhab2/start.sh’ openhab

Thankyou for any guidance

There usually is a “skeleton” file in /etc/init.d which gives you the structure and the bulk of the script you need. All you need to do is fill in the variables at the top. You could also look around in those scripts for a simple example to pull from. I’ve been on systemd based systems for so long I don’t remember the specifics any longer.

thankyou Rich for the pointers.

The below method worked for me, whether it is secure or otherwise I am not an expert:

I ended up creating a file /etc/init/openhab2.conf:
sudo nano /etc/init/openhab2.conf

description “openhab2”
start on net-device-up
respawn
exec sudo su -s /bin/bash -c ‘/opt/openhab2/start.sh’ openhab

then a reboot.
This worked for me on Ubuntu 14.04 LTS, whether it is regarded as a bodge or otherwise!