Open Hab fails to start after upgrade - Pi2

I am running the latest nightly of OH2 installed via repository.

Performed a full update/upgrade of my Pi and now cannot start the service.

Have attempted reboot. Also cannot SSH into Karaf console.

● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: failed (Result: start-limit) since Fri 2016-11-11 23:18:53 AEST; 43s ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 1541 ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop (code=exited, status=203/EXEC)
  Process: 1424 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=1/FAILURE)
 Main PID: 1424 (code=exited, status=1/FAILURE)

Nov 11 23:18:44 raspberrypi systemd[1]: Unit openhab2.service entered failed state.
Nov 11 23:18:53 raspberrypi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 11 23:18:53 raspberrypi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 11 23:18:53 raspberrypi systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 11 23:18:53 raspberrypi systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Nov 11 23:18:53 raspberrypi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Nov 11 23:18:53 raspberrypi systemd[1]: Unit openhab2.service entered failed state.
pi@raspberrypi:~ $ /usr/share/openhab2/start.sh
Launching the openHAB runtime...
karaf: KARAF_BASE is not valid: /usr/share/openhab2/userdata
pi@raspberrypi:~ $ sudo /usr/share/openhab2/start.sh
Launching the openHAB runtime...
karaf: KARAF_BASE is not valid: /usr/share/openhab2/userdata


here’s the contents of openhab2:

pi@raspberrypi:/usr/share/openhab2 $ ls
addons  bin  LICENSE.TXT  runtime  start_debug.sh  start.sh

Any help would be greatly appreciated.

Thanks Duncan

More info:
I started the service again, appears to briefly start, then fails.

pi@raspberrypi:/usr/share/openhab2 $ sudo systemctl start openhab2.service -l
pi@raspberrypi:/usr/share/openhab2 $ sudo systemctl status openhab2.service -l
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: active (running) since Fri 2016-11-11 23:40:23 AEST; 672ms ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 2340 ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop (code=exited, status=203/EXEC)
 Main PID: 2343 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─2343 /bin/sh /usr/share/openhab2/runtime/bin/karaf server
           ├─2401 /bin/sh /usr/share/openhab2/runtime/bin/karaf server
           ├─2402 /usr/bin/java -version
           ├─2403 grep -E "([0-9].[0-9]\..*[0-9]).*"
           ├─2404 awk {print substr($3,2,length($3)-2)}
           ├─2405 awk {print substr($1, 3, 3)}
           └─2406 sed -e s;\.;;g

Nov 11 23:40:23 raspberrypi systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 11 23:40:23 raspberrypi systemd[1]: Started openHAB 2 - empowering the smart home.
Nov 11 23:40:23 raspberrypi start.sh[2343]: Launching the openHAB runtime...
pi@raspberrypi:/usr/share/openhab2 $ sudo systemctl status openhab2.service -l
● openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
   Active: failed (Result: start-limit) since Fri 2016-11-11 23:40:25 AEST; 21s ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
  Process: 2425 ExecStop=/usr/share/openhab2/runtime/karaf/bin/stop (code=exited, status=203/EXEC)
  Process: 2343 ExecStart=/usr/share/openhab2/start.sh server (code=exited, status=1/FAILURE)
 Main PID: 2343 (code=exited, status=1/FAILURE)

Nov 11 23:40:24 raspberrypi systemd[1]: Unit openhab2.service entered failed state.
Nov 11 23:40:25 raspberrypi systemd[1]: openhab2.service holdoff time over, scheduling restart.
Nov 11 23:40:25 raspberrypi systemd[1]: Stopping openHAB 2 - empowering the smart home...
Nov 11 23:40:25 raspberrypi systemd[1]: Starting openHAB 2 - empowering the smart home...
Nov 11 23:40:25 raspberrypi systemd[1]: openhab2.service start request repeated too quickly, refusing to start.
Nov 11 23:40:25 raspberrypi systemd[1]: Failed to start openHAB 2 - empowering the smart home.
Nov 11 23:40:25 raspberrypi systemd[1]: Unit openhab2.service entered failed state.


apt update/upgrade doesn’t work at the moment and indeed currently breaks the installation. See here:

https://community.openhab.org/t/openhabian-hassle-free-rpi-image/13379/285
2 Likes

Wow, thanks for the fast update @jaydee73.

Looking forward to a speedy resolution.

Hi, this is my first contribution.
I´m using OH2 but on a Pi3
I’ve already made a “general” update (sudo apt-get update + sudo apt-get upgrade) and since than the openhab2.service failed every time it was started.

I found a solution editing file ‘/lib/systemd/system/openhab2.service’.
Originally it was like this:
"
[Unit]
Description=The openHAB 2 Home Automation Bus Solution
Documentation=http://docs.openhab.org
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=openhab
Group=openhab
GuessMainPID=yes
WorkingDirectory=/opt/openhab2
ExecStart=/opt/openhab2/start.sh server
ExecStop=/bin/kill -SIGINT $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target
"

and I’ve changed to this:
"…
WorkingDirectory=/usr/share/openhab2
ExecStart=/usr/share/openhab2/start.sh server

"

/usr/share/openhab2 is in fact my APPlication directory.

I hope beeing helpful

1 Like

“Muito obrigado”, Filipe!

After the changes that you mentioned I just had to:

sudo systemctl reload
sudo systemctl restart openhab2.service

To see if it’s working now:

sudo systemctl status openhab2.service

  pi@lcp-srv:~ $ sudo /bin/systemctl status openhab2.service
● openhab2.service - The openHAB 2 Home Automation Bus Solution
   Loaded: loaded (/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2017-08-24 21:03:14 UTC; 7s ago
     Docs: http://docs.openhab.org
 Main PID: 1313 (karaf)
   CGroup: /system.slice/openhab2.service
           ├─1313 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           ├─1455 /bin/bash /usr/share/openhab2/runtime/bin/karaf server
           ├─1456 /usr/bin/java -version
           ├─1457 grep -E "([0-9].[0-9]\..*[0-9]).*"
           ├─1458 awk {print substr($3,2,length($3)-2)}
           ├─1459 awk {print substr($1, 3, 3)}
           └─1460 sed -e s;\.;;g