Hello together I have followed the instructions of Martin to install openhab2 on the AXC F 2152. Anything’s work fine, but issue, that openhab won’t start automatically after a reboot is a little bit annoying. That forces me to change it, and here is the solution. 1) Because of the fact, that standard text files couldn’t be uploaded (-> hopefully the admins will change that soon after they have eliminated the worm hole) I have attached the sources of the script behind this article. You have to copy & paste it and store it inside a file named "openhab2 " (TAKE CARE ABOUT, THAT IT HAS TO BE STORED FOR LINUX SYSTEMS) With notepad++, you can configure it under /settings/Preferences/NewDocuments → Change it to UNIX…then the string termination will be LF 2) After that, you have to copy this file to the PLC inside the folder "/etc/init.d " (Login as root, otherwise it causes problems) 3) Open a terminal session and login as root user 4) Type in following command "update-rc.d openhab2 defaults 80 10 " 5) Be happy From that point, openhab2 will start automatically after boot. You can run the script as root as follows : ./openhab2 (start | stop | restart) ##################################################### Script Section ################################################### #!/bin/sh
BEGIN INIT INFO
Provides: Start | Stop | Restart of openhab2
Required-Start: network ha sto be started
Required-Stop: Was muss vorher beendet werden?
Default-Start: 2 3 4 5
Default-Stop: 0 1 6
Short-Description: Script to start, stop and restart openhab
Description: The script starts openhab normally. Stopping openhab is
realised by scanning for process Ids and first kiling the karaf console
and then the main process (this may take a while)
END INIT INFO
Author: Michael Gulsch # Aktionen umask 077 scan_process(){
scan_result=
ps | grep $1
scan_result=$(echo ${scan_result%%root*})
scan_result=$(echo ${scan_result%% })
space=
scan_result=$space$scan_result
if [ $scan_result -eq 0 ] | [ $scan_result -ne $1 ];
then
echo “0”
else
echo “1”
fi
}
start(){
/opt/openhab2/start.sh server &
echo “Openhab2 - Service started”
} stop(){
grep_result=ps | grep {karaf}
grep_result=$(echo ${grep_result%%root})
grep_result=$(echo ${grep_result%% })
space=
grep_result=$space$grep_result
kill $grep_result
scan=“1”
echo "Openhab2 - started to kill “karaf” terminal: " $grep_result
while [[ $scan -eq 1 ]]; do
scan=scan_process $grep_result
sleep 1
echo -n “.”
done
echo
echo “Openhab2 - Terminal terminated”
grep_result=ps | grep Dopenhab
grep_result=$(echo ${grep_result%%root})
grep_result=$(echo ${grep_result%% *})
grep_result=$space$grep_result
kill $grep_result
scan=“1”
echo "Openhab2 - started to kill main process: " $grep_result
while [[ $scan -eq 1 ]]; do
scan=scan_process $grep_result
sleep 1
echo -n “.”
done
echo
echo “Openhab2 - Main process terminated”
} restart(){
stop && start
} case “$1” in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo “use: openhab2 {start|stop|restart}”
exit 1
;;
esac exit $?

