screen is a Linux application you can install using apt that can emulate a terminal. Many use it to keep a process running when starting it manually from a remote session.
Install screen
Run screen
Start openhab
Detach from screen (ctrl+a then ctrl+d)
Safely logout of your linux box
Use screen -r to get back into the session running out
root@localhost:/home/android# start.sh
.bash: start.sh: command not found
root@localhost:/home/android# cd ..
root@localhost:/home# cd ..
root@localhost:/# cd usr/
root@localhost:/usr# cd share/
root@localhost:/usr/share# cd openhab2/
root@localhost:/usr/share/openhab2# start.sh
bash: start.sh: command not found
root@localhost:/usr/share/openhab2# ls
LICENSE.TXT addons runtime start.sh start_debug.sh
root@localhost:/usr/share/openhab2# start.sh
bash: start.sh: command not found
root@localhost:/usr/share/openhab2# start
bash: start: command not found
root@localhost:/usr/share/openhab2#
I’m not sure where start.sh is located in an apt install. You should find it in one of these directories…
If I were to guess, I’d try /usr/share/openhab2/start.sh. Also, you’ll need to fully qualify the name. You could go to the direcotry and use ./start.sh, but I recall an issue with that because of how the DIRNAME variable is defined.
root@localhost:/home/android# /usr/share/openhab2/start.sh
Launching the openHAB runtime...
mkdir: cannot create directory '/usr/share/openhab2/userdata/tmp': No such file or directory
KARAF_BASE is not valid: /usr/share/openhab2/userdata
root@localhost:/home/android#
root@localhost:/home/android# cd /usr/share/openhab2
root@localhost:/usr/share/openhab2# ls
LICENSE.TXT addons nohup.out runtime start.sh start_debug.sh
root@localhost:/usr/share/openhab2# /usr/share/openhab2/start.sh
Launching the openHAB runtime...
mkdir: cannot create directory '/usr/share/openhab2/userdata/tmp': No such file or directory
KARAF_BASE is not valid: /usr/share/openhab2/userdata
root@localhost:/usr/share/openhab2# mkdir userdata
root@localhost:/usr/share/openhab2# /usr/share/openhab2/start.sh
Launching the openHAB runtime...
KARAF_ETC is not valid: /usr/share/openhab2/userdata/etc
root@localhost:/usr/share/openhab2# cd userdata
root@localhost:/usr/share/openhab2/userdata# ls
tmp
root@localhost:/usr/share/openhab2/userdata# mkdir etc
root@localhost:/usr/share/openhab2/userdata# /usr/share/openhab2/start.sh
Launching the openHAB runtime...
null
Error occurred shutting down framework: java.lang.NumberFormatException: null
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:542)
at java.lang.Integer.parseInt(Integer.java:615)
at org.apache.karaf.main.ConfigProperties.<init>(ConfigProperties.java:2 30)
at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:2 27)
at org.apache.karaf.main.Main.main(Main.java:192)
root@localhost:/usr/share/openhab2/userdata#
You could try putting this in rc.local to launch a screen session, and launches OH in the session (this is what we used before setting up the service)…
nothing happens
websites doesn’t start
can’t see java on top
and i see this:
root@localhost:/home/android# screen -ls
There are screens on:
5830.openhab (01/09/19 05:23:54) (Dead ???)
6011.openhab (01/09/19 05:23:54) (Dead ???)
Remove dead screens with 'screen -wipe'.
2 Sockets in /var/run/screen/S-root.