[SOLVED] OH Install on Ubuntu fails at service startup

I installed OH2 following this doc: h_t_t_p_s: docs.openhab.org/installation/linux.html#package-repository-installation

And I can’t get the OH service running.

I get this when looking at the service’s status after a short while:

johan@johan-MS-7641:~$ sudo /bin/systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since jeu. 2017-12-21 17:15:38 CET; 3s ago
Docs: http://docs.openhab.org
<h_t_t_p_s>://community.openhab.org
Process: 21382 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
Process: 21363 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, sta
Main PID: 21363 (code=exited, status=1/FAILURE)

déc. 21 17:15:38 johan-MS-7641 systemd[1]: openhab2.service: Control process exited, code=exited stat
déc. 21 17:15:38 johan-MS-7641 systemd[1]: openhab2.service: Unit entered failed state.
déc. 21 17:15:38 johan-MS-7641 systemd[1]: openhab2.service: Failed with result ‘exit-code’.

I tried this before, since it was suggested in a post about a similar problem, but no change:
sudo systemctl daemon-reload
sudo systemctl enable openhab2.service
sudo systemctl restart openhab2.service

My Ubuntu Kernel version (this is an AMD64 machine):
uname -a
Linux johan-MS-7641 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Any hint would be welcome :slight_smile:
P.S. http links were modified with underscores otherwise my post would be rejected

Did you perform the prerequisites before installing OH, namely installing Java?

http://docs.openhab.org/installation/index.html#prerequisites

Very good question! I had Oracle java on my machine until I had to reinstall after a crash - rare thing under Linux - and I forgot that I did not reinstall absolutely everything…

After instaling Java, it does not look like Openhab2 is able to start…:

johan@johan-MS-7641:~$ java -version
openjdk version "9.0.0.15"
OpenJDK Runtime Environment (Zulu build 9.0.0.15+181)
OpenJDK 64-Bit Server VM (Zulu build 9.0.0.15+181, mixed mode)
johan@johan-MS-7641:~$ sudo openhab-cli status
A systemd service configuration exists…
Use ‘sudo /bin/systemctl status openhab2.service’ to find the status of an openHAB service
openHAB is not running.
johan@johan-MS-7641:~$ sudo systemctl restart openhab2.service
johan@johan-MS-7641:~$ sudo /bin/systemctl status openhab2.service
● openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since jeu. 2017-12-21 23:03:48 CET; 1s ago
Docs: http__docs.openhab.org
https___community.openhab.org
Process: 24094 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
Process: 24008 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAI
Main PID: 24008 (code=exited, status=1/FAILURE)

déc. 21 23:03:48 johan-MS-7641 systemd[1]: openhab2.service: Unit entered failed state.
déc. 21 23:03:48 johan-MS-7641 systemd[1]: openhab2.service: Failed with result ‘exit-code’.
lines 1-11/11 (END)

Any clues?
Johan

You installed Java9 which is known not to work atm. Please step back to Java8

That looks better - thanks!:

johan@johan-MS-7641:~$ java -version
openjdk version "1.8.0_152"
OpenJDK Runtime Environment (Zulu 8.25.0.1-linux64) (build 1.8.0_152-b16)
OpenJDK 64-Bit Server VM (Zulu 8.25.0.1-linux64) (build 25.152-b16, mixed mode)
johan@johan-MS-7641:~$ sudo openhab-cli status
A systemd service configuration exists…
Use ‘sudo /bin/systemctl status openhab2.service’ to find the status of an openHAB service
openHAB is running with PID: 30912 and has been running for 02:33
johan@johan-MS-7641:~$

The OpenHab2 prerequisites page sending me to the Zulu download did not mention version 8 being mandatory…

Next is: how to start the OpenHab2 GUI… I will find out.

I went back to the http://docs.openhab.org/installation/linux.html#command-line-interface-cli page
and tried "sudo su -s /bin/bash -c ‘/opt/openhab2/start.sh’ openhab"
but the directory /opt/openhab2 does not exist…

Johan

openhab is now running, so you should be able to go to the Web browser and open the webpage <local_ip>:8080.

The instructions you were reading with the (/opt/ folder) are for manual installations, but you are using packaged installation.

Right, that sends me back to the doc that I read initially.
Thanks again to all involved

1 Like