[SOLVED] AutoStart OpenHab on Linux Chroot

You changed it… use stuffhttps://www.gnu.org/software/screen/manual/screen.html#Paste

1 Like

ok. we are moving:

root@localhost:/home# screen -list
There are screens on:
        8167.openhab2   (01/09/19 05:44:45)     (Detached)
        5312.openhab    (01/09/19 05:41:11)     (Dead ???)
Remove dead screens with 'screen -wipe'.
2 Sockets in /var/run/screen/S-root.

screen -r openhab2

root@localhost:~# /opt/openhab2/start.sh
Launching the openHAB runtime...
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:230)
        at org.apache.karaf.main.Main.updateInstancePidAfterShutdown(Main.java:227)
        at org.apache.karaf.main.Main.main(Main.java:192)

same error as before, it had to do with the user.
how can i run:

sudo su -s /bin/bash -c '/opt/openhab2/start.sh' root
in screen instead of

YEEEES!!! --------------

created another script


sudo su -s /bin/bash -c '/opt/openhab2/start.sh' root

an then in

screen -d -m -S openhab2
screen -S openhab2 -p 0 -X stuff "/opt/openhab2/start2.sh$(printf \\r)"

And now it starts automatically!!!

Thanks man for all the help!

Best regards.