openHAB on PI 2 works, but not as service

Hi!

I’ve installed openHAB on my Raspberry PI 2 running Raspbian Jessie. It is installed in /opt/openhab. I can start it using “sudo ./start.sh” and am able to access the web interface. I then tried to install it as service, but it just doesnt seem to work.

I used this guide (systemd section): https://openhabdoc.readthedocs.io/de/latest/Autostart/#autostart-mit-systemd

When I run “netstat -tlpe” I cannot see openHAB listed.

pi@darthbane:/opt/openhab $ sudo service openhab start
pi@darthbane:/opt/openhab $ sudo service openhab status
â— openhab.service - A vendor and technology agnostic open source automation software for your smart home.
   Loaded: loaded (/etc/systemd/system/openhab.service; enabled)
   Active: active (running) since Mi 2017-01-11 15:51:31 CET; 8min ago
  Process: 567 ExecStart=/usr/bin/openhab (code=exited, status=0/SUCCESS)
 Main PID: 580 (java)
   CGroup: /system.slice/openhab.service
           └─580 java -Dosgi.clean=true -Declipse.ignoreApp=true -Dosgi.noShutdown=true -Djetty.port=8080 -Djetty.port.ssl=8443 -Djetty.home=. -Dlogback.configurationFile=configurations...

Jan 11 15:52:45 darthbane openhab[567]: 2017-01-11 15:52:45.393 [ERROR] [b.s.internal.SysteminfoBinding] - System monitor error: {}
Jan 11 15:52:45 darthbane openhab[567]: org.hyperic.sigar.SigarException: java.lang.UnsatisfiedLinkError: org.hyperic.sigar.Sigar.getNetInterfaceList()[Ljava/lang/String;
Jan 11 15:52:45 darthbane openhab[567]: at org.hyperic.sigar.SigarProxyCache.invoke(SigarProxyCache.java:220) ~[sigar-1.6.4.jar:na]
Jan 11 15:52:45 darthbane openhab[567]: at com.sun.proxy.$Proxy76.getNetInterfaceList(Unknown Source) ~[na:na]
Jan 11 15:52:45 darthbane openhab[567]: at org.openhab.binding.systeminfo.internal.SysteminfoBinding.initializeSystemMonitor(SysteminfoBinding.java:419) [bundlefile:na]
Jan 11 15:52:45 darthbane openhab[567]: at org.openhab.binding.systeminfo.internal.SysteminfoBinding.updated(SysteminfoBinding.java:403) [bundlefile:na]
Jan 11 15:52:45 darthbane openhab[567]: at org.eclipse.equinox.internal.cm.ManagedServiceTracker$1.run(ManagedServiceTracker.java:183) [org.eclipse.equinox.cm_1.0.400.v20120...1841.jar:na]
Jan 11 15:52:45 darthbane openhab[567]: at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run(SerializedTaskQueue.java:36) [org.eclipse.equinox.cm_1.0.400.v20120522-1841.jar:na]
Jan 11 15:52:45 darthbane openhab[567]: 2017-01-11 15:52:45.399 [INFO ] [.service.AbstractActiveService] - Systeminfo Refresh Service has been started
Jan 11 16:00:03 darthbane systemd[1]: Started A vendor and technology agnostic open source automation software for your smart home..
Hint: Some lines were ellipsized, use -l to show in full.
pi@darthbane:/opt/openhab $

Okay, after further review of netstat -tlpe:

netstat -tlpe
(Für "-p": geteuid()=1000 konnte keine Information gelesen werden; sie sollten Root sein.)
Aktive Internetverbindungen (Nur Server)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 *:9090                  *:*                     LISTEN      squeezeboxserver 11443       -
tcp        0      0 *:9000                  *:*                     LISTEN      squeezeboxserver 8590        -
tcp        0      0 *:netbios-ssn           *:*                     LISTEN      root       11491       -
tcp        0      0 *:ssh                   *:*                     LISTEN      root       1869        -
tcp        0      0 *:3483                  *:*                     LISTEN      squeezeboxserver 8460        -
tcp        0      0 *:microsoft-ds          *:*                     LISTEN      root       11490       -
tcp6       0      0 [::]:netbios-ssn        [::]:*                  LISTEN      root       11489       -
tcp6       0      0 [::]:http-alt           [::]:*                  LISTEN      root       8612        -
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN      root       1871        -
tcp6       0      0 [::]:8443               [::]:*                  LISTEN      root       10309       -
tcp6       0      0 [::]:microsoft-ds       [::]:*                  LISTEN      root       11488       -

I found the https-Port 8443 is open. And indeed, I can access openHAB on that port. Can anyone tell me, why it does not start on 8080?

Thanks!

Any reason you’re not using the Debian package? It runs as a service in that scenario.

Ive tested with OpenHAB2 yesterday, using the Debian package. I discarded v2 for various reasons. I’ve chosen the manual install of OpenHAB now because many tutorials use the manual install. I dont think there is a reason why the manual installation should not work. I dont really intend to switch to the package installation.

Whilst I can’t help with your specific service issue, what were the reasons you discarded OH2? The reason I ask is that IMO it’s easier to get OH2 up and running (as a service) and also there is no active development on OH1.

With openHAB 2.0 having been under development for many moons and with the final 2.0 release around the corner I can safely tell you that most tutorials you can find are outdated or not representing the current state. Please follow the official documentation which is always up to date.

The Linux article states:

The installation through the provided package repository (using apt-get) is recommended for end users.

Also pay attention to this part of the Raspberry Pi article:

We are proud to provide a preconfigured image for the Raspberry Pi, with the latest build of openHAB 2 and many useful software components (like Samba, Grafana or Mosquitto) as optional setup steps. openHABian is based on Raspbian and under constant improvement.

1 Like