Openhab2 does not start after installation

Hi all
I am using an Orange Pi Zero with Armbian.
Release = Debian GNU/Linux 8 (jessie)
Kernel = Linux 3.4.113-sun8i

I installed openhab via openhabian on this orange pi zero. To do so, I defined a user openhab and proceeded according to the instructions:

download and link

sudo git clone https://github.com/openhab/openhabian.git /opt/openhabian
sudo ln -s /opt/openhabian/openhabian-setup.sh /usr/local/bin/openhabian-config

execute

sudo openhabian-config

You’ll see the openHABian configuration menu and can now select all desired actions. The “Manual/Fresh Setup” submenu entry is the right place for you. Execute all entries one after the other to get the full openHABian experience.

After executing all submenu entries I specified “expert” in addons.cfg and rebooted.
After reboot, the dashboard is not reachable. The log says:

2018-01-25 10:31:05.236 [thome.event.ExtensionEvent] - Extension ‘package-expert’ has been installed.
2018-01-25 10:31:30.283 [INFO ] [.dashboard.internal.DashboardService] - Stopped dashboard

The answer to
sudo systemctl status openhab2
is
openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2018-01-25 10:42:56 CET; 3s ago
Docs: http://docs.openhab.org
https://community.openhab.org
Process: 18166 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
Process: 18075 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAILURE)
Main PID: 18075 (code=exited, status=1/FAILURE)

Running the start.sh script from /usr/share/openhab2 shows mkdir error:

sudo sh -x start.sh
[sudo] password for openhab:

  • echo Launching the openHAB runtime…
    Launching the openHAB runtime…
  • dirname start.sh
  • DIRNAME=.
  • exec ./runtime/bin/karaf
    mkdir: cannot create directory â/usr/share/openhab2/userdata/tmpâ: No such file or directory
    KARAF_BASE is not valid: /usr/share/openhab2/userdata

As a noob in Linux I am stuck.

Any hints?
Many thanks an advance!

Hi @Ren001,

To start openHAB as a service when using the Linux packages, you would normally use the command

sudo systemctl start openhab2.service 

If this command fails for any reason, there should be some sort of error listed near the bottom of the output when you use the command:

journalctl -u openhab2.service -b

If openHAB starts but suffers an error while running, there may be an error in /var/log/openhab2/openhab.log. Let us know what you find and hopefully we can help out.

Hi @Benjy

Thanks for your hints. When I issue the commands, the result is:

[15:33:01] openhab@orangepizero:~$ sudo systemctl start openhab2.service
[sudo] password for openhab:
[15:33:32] openhab@orangepizero:~$ journalctl -u openhab2.service -b
No journal files were found.
[15:33:53] openhab@orangepizero:~$ sudo systemctl status openhab2.service
â openhab2.service - openHAB 2 - empowering the smart home
Loaded: loaded (/usr/lib/systemd/system/openhab2.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2018-01-25 15:34:54 CET; 1s ago

Process: 9676 ExecStop=/usr/share/openhab2/runtime/bin/karaf stop (code=exited, status=1/FAILURE)
Process: 9585 ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE (code=exited, status=1/FAILURE)
Main PID: 9585 (code=exited, status=1/FAILURE)

Jan 25 15:34:54 orangepizero systemd[1]: Unit openhab2.service entered faile…
Hint: Some lines were ellipsized, use -l to show in full.

I assume the problem are the environment variables (beause of the message KARAF_BASE is not valid)

Sorry, I meant to include sudo in the journalctl command:

sudo journalctl -u openhab2.service -b

any difference?

Oh yes, now it looks like an endless loop of retries to start openhab2:

Jan 25 15:32:36 orangepizero systemd[1]: openhab2.service holdoff time over, scheduling restart.
Jan 25 15:32:36 orangepizero systemd[1]: Stopping openHAB 2 - empowering the smart home…
Jan 25 15:32:36 orangepizero systemd[1]: Starting openHAB 2 - empowering the smart home…
Jan 25 15:32:36 orangepizero systemd[1]: Started openHAB 2 - empowering the smart home.
Jan 25 15:32:37 orangepizero karaf[5409]: /usr/share/openhab2/runtime/bin/karaf: 199: [: Illegal number:
Jan 25 15:32:37 orangepizero karaf[5409]: /usr/share/openhab2/runtime/bin/karaf: 199: [: Illegal number:
Jan 25 15:32:37 orangepizero karaf[5409]: Critical /proc/self/exe readlink failure.
Jan 25 15:32:37 orangepizero systemd[1]: openhab2.service: main process exited, code=exited, status=1/FAILURE
Jan 25 15:32:38 orangepizero karaf[5500]: /usr/share/openhab2/runtime/bin/karaf: 199: [: Illegal number:
Jan 25 15:32:38 orangepizero karaf[5500]: /usr/share/openhab2/runtime/bin/karaf: 199: [: Illegal number:
Jan 25 15:32:38 orangepizero karaf[5500]: Critical /proc/self/exe readlink failure.
Jan 25 15:32:38 orangepizero systemd[1]: openhab2.service: control process exited, code=exited status=1
Jan 25 15:32:38 orangepizero systemd[1]: Unit openhab2.service entered failed state.

This is line 199 of karaf:
OPTS="-Dkaraf.startLocalConsole=false -Dkaraf.startRemoteShell=true -Dkaraf.log.console=ALL"

Does the command:

java -version

Make the same “Critical /proc/self/exe readlink failure.” error? If so, you’ll need to reinstall Java.

Many thanks for your ongoing support!

Java is fine, java -version shows
openjdk version "1.8.0_152"
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)

Hmm, That’s the same one I’m on, but for a RPi. I wonder if it has anything to do with different processor on the Orange Pi? Does another iteration of Java (such as Oracle JDK do anything differently?