[Solved] Error Installing version 1.8 on Debian 8.3 (Jessie)

Hi,

I am trying to install OH 1.8 on Debian Jessie running on a cubietruck.

I have Java 1.8.0_71 installed. I am following the install instruction from this link:

During the installation I get the following error:

> Reading package lists... Done
> Building dependency tree       
> Reading state information... Done
> The following NEW packages will be installed:
>   openhab-runtime
> 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
> Need to get 0 B/36.8 MB of archives.
> After this operation, 41.4 MB of additional disk space will be used.
> Selecting previously unselected package openhab-runtime.
> (Reading database ... 56832 files and directories currently installed.)
> Preparing to unpack .../openhab-runtime_1.8.0_all.deb ...
> Unpacking openhab-runtime (1.8.0) ...
> Processing triggers for systemd (215-17+deb8u3) ...
> Setting up openhab-runtime (1.8.0) ...
> Failed to get D-Bus connection: Unknown error -1
> dpkg: error processing package openhab-runtime (--configure):
>  subprocess installed post-installation script returned error exit status 1
> Errors were encountered while processing:
>  openhab-runtime
> E: Sub-process /usr/bin/dpkg returned an error code (1)

Any help would be appreciated,

Thank you,

Mike

Could this be a problem with the fact the Debian Jessie uses systemd rather than init? Does OH 1.8 know how to configure with systemd?

Regards,

Mike

In case anyone runs into the same issue I resolved the problem.

By default Debian version 8.0+ should be running systemd, but for some reason the version I have that was compiled for cubietruck is running init.

To validate this type the following:

cat /proc/1/comm

The output should be systemd, but in my case the output was init.

To upgrade I ran the following:

apt-get install systemd-sysv

then I rebooted. After the reboot I was able to install OH 1.8 without error.

Regards,

Mike

1 Like

Thanks a heap Mike, it helped me too in my Banana Pi - M2 using armbian (debian 8.3) and systemd is not the default one.

No Problem. I am running the same build as you (armbian). According to all I’ve read, as of Debain 8, it should boot into systemd, not sure why this one isn’t. In any case it’s an easy fix.

Mike

Dear Mike,

thanks for the tip, but if I ask for:

cat /proc/1/comm

I get ‘systemd’ already, and the ‘apt-get install systemd-sysv’ says it’s already installed - of course…

I run osmc - formerly Raspbmc. It is on jessie base.

I get this error:

‘Setting up openhab-runtime (1.8.1) …
Job for openhab.service failed. See ‘systemctl status openhab.service’ and ‘journalctl -xn’ for details.
dpkg: error processing package openhab-runtime (–configure):
subprocess installed post-installation script returned error exit status 1
E: Sub-process /usr/bin/dpkg returned an error code (1)’

Any idea?

Greetings,
Rob

Hi Robert,

What did you get when you ran systemctl status openhab.service and journalctl -xn?

Before running journalctl -xn try to run systemctl start openhab.service first.

The journalctl output may give more details as to what is happening.

For troubleshooting you can try and run openhab from the command line rather than as a service, That way you can see any error message that may not appear otherwise.

Also, after trying to start openhab did you take a look at the openhab.log file in /var/log/openhab?

I’m pretty sure OSMC is a stripped down version of the full Jessie, but how much it’s stripped down I’m not sure though.

Regards,

Mike

Hi Mike,

I get after status openhab.service:
* openhab.service - Starts and stops the openHAB Home Automation Bus
Loaded: loaded (/usr/lib/systemd/system/openhab.service; disabled)
Active: failed (Result: resources)
Docs: http://www.openhab.org

When I try to run start openhab.service:
Failed to start openhab.service: Access denied

With sudo: the error is the same.

After sudo journalctl -xn:
– Logs begin at Thu 2016-02-25 17:53:35 CET, end at Tue 2016-03-01 19:22:57 CET. –
Mar 01 19:22:37 Jarvis sshd[8121]: PAM service(sshd) ignoring max retries; 6 > 3
Mar 01 19:22:41 Jarvis sshd[8127]: reverse mapping checking getaddrinfo for 232.5.47.59.broad.bx.ln.dynamic.163data.com.cn [59.47.
Mar 01 19:22:41 Jarvis sshd[8127]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=59.47.5
Mar 01 19:22:43 Jarvis sshd[8127]: Failed password for root from 59.47.5.232 port 2376 ssh2
Mar 01 19:22:46 Jarvis sshd[8127]: Failed password for root from 59.47.5.232 port 2376 ssh2
Mar 01 19:22:48 Jarvis sshd[8127]: Failed password for root from 59.47.5.232 port 2376 ssh2
Mar 01 19:22:51 Jarvis sshd[8127]: Failed password for root from 59.47.5.232 port 2376 ssh2
Mar 01 19:22:54 Jarvis sshd[8127]: Failed password for root from 59.47.5.232 port 2376 ssh2
Mar 01 19:22:57 Jarvis sudo[8131]: osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=root ; COMMAND=/bin/journalctl -xn
Mar 01 19:22:57 Jarvis sudo[8131]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)

Any idea would be very appreciated :slightly_smiling:

Greetings,
Rob

I just don’t understand, why are those failed attempt lines in? They’re at time, when I try to start the service…

Hi Robert,

Everything seems to point to a permissions problem. Before stating openhab change to root user by typing sudo su then try to start openhab.

Also, check to see who owns the openhab.sh file. To check that type ls -l /usr/share/openhab/bin/openhab.sh Unless you have installed somewhere else.

You should see the root group as the owner and the root user as the one who can execute the file.

Mike

Hi Mike,

I’ve done the chmod root:root, because it was openhab:openhab.

after it was done, I’ve ran your command after sudo su, and I got:

systemctl start openhab service
Failed to start service.service: Unit service.service failed to load: No such file or directory.
Job for openhab.service failed. See 'systemctl status openhab.service' and 'journalctl -xn' for details.

The journalctl -xn drops the same :frowning:

Do you have still something in your pocket? :slightly_smiling:

I see you typed systemctl start openhab service. There should be a period between openhab and service.

Also, if the permission on openhab.sh were wrong it’s likely that other files also have wrong permissions.

MIKE

Dear Mike,

thank you, you’re right!

But I’ve have the same error:

root@Jarvis:/home/osmc# systemctl start openhab.service
Job for openhab.service failed. See 'systemctl status openhab.service' and 'journalctl -xn' for details.

After systemctl status openhab.service:
root@Jarvis:/home/osmc# systemctl -l status openhab.service
* openhab.service - Starts and stops the openHAB Home Automation Bus
Loaded: loaded (/usr/lib/systemd/system/openhab.service; disabled)
Active: failed (Result: resources)
Docs: http://www.openhab.org

Mar 03 19:00:17 Jarvis systemd[1]: Failed to start Starts and stops the openHAB Home Automation Bus.
Mar 07 09:05:47 Jarvis systemd[1]: Failed to load environment files: No such file or directory
Mar 07 09:05:47 Jarvis systemd[1]: openhab.service failed to run 'start-pre' task: No such file or directory
Mar 07 09:05:47 Jarvis systemd[1]: Failed to start Starts and stops the openHAB Home Automation Bus.
Mar 07 09:33:39 Jarvis systemd[1]: Failed to load environment files: No such file or directory
Mar 07 09:33:39 Jarvis systemd[1]: openhab.service failed to run 'start-pre' task: No such file or directory
Mar 07 09:33:39 Jarvis systemd[1]: Failed to start Starts and stops the openHAB Home Automation Bus.
Mar 07 09:36:33 Jarvis systemd[1]: Failed to load environment files: No such file or directory
Mar 07 09:36:33 Jarvis systemd[1]: openhab.service failed to run 'start-pre' task: No such file or directory
Mar 07 09:36:33 Jarvis systemd[1]: Failed to start Starts and stops the openHAB Home Automation Bus.

Now it’s more than before :slightly_smiling:

and

journalctl -xn drops this:

Mar 07 09:33:27 Jarvis sudo[19914]: pam_unix(sudo:session): session opened for user root by osmc(uid=0)
Mar 07 09:33:27 Jarvis su[19915]: Successful su for root by root
Mar 07 09:33:27 Jarvis su[19915]: + /dev/pts/0 root:root
Mar 07 09:33:27 Jarvis su[19915]: pam_unix(su:session): session opened for user root by osmc(uid=0)
Mar 07 09:33:39 Jarvis systemd[1]: Failed to load environment files: No such file or directory
Mar 07 09:33:39 Jarvis systemd[1]: openhab.service failed to run ‘start-pre’ task: No such file or directory
Mar 07 09:33:39 Jarvis systemd[1]: Failed to start Starts and stops the openHAB Home Automation Bus.
– Subject: Unit openhab.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit openhab.service has failed.

– The result is failed.
Mar 07 09:36:33 Jarvis systemd[1]: Failed to load environment files: No such file or directory
Mar 07 09:36:33 Jarvis systemd[1]: openhab.service failed to run ‘start-pre’ task: No such file or directory
Mar 07 09:36:33 Jarvis systemd[1]: Failed to start Starts and stops the openHAB Home Automation Bus.
– Subject: Unit openhab.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit openhab.service has failed.

– The result is failed.

regards,
Rob

Hi Robert,

I would have to do more research into this. However I am on the road all week for work and won’t have much time.

Mike

Dear Mike,
thank you for your support, I think, I’ll be making a fresh reinstall, and I’ll be back with the results!

Greetings,

Robert