OpenHab do not autostart at boot

Hi,
I installed OH2 on Debian using apt method.
I also used rcconf to setup openhab service for autostart, but after a reboot, OH2 is stopped.
Someone can help me?

Marco

If you installed using apt-get there is no need to do anything else to set it up for autostart. I suspect what ever you did using rcconf has caused a conflict which is preventing it from starting.

I’d recommend reinstalling using apt-get and undoing what ever you did with rcconf.

Look at the openHAB logs to see why OH is not starting (bind errors I would guess). Check your syslog during startup to see errors that may appear there which might be helpful.

The vast majority of apt-get supported operating systems now use systemd to control services like this. What do you see and what happens when you run

sudo systemctl status openhab
sudo systemctl start openhab

Hi,
after reboot, there is nothing in syslog and in openhab logs.
I deleted all openhab logs, and after reboot nothing is wrote.
Running systemctl status openhab i got:

â openhab.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

After firing the start commenad, the status is this:

â openhab2.service - openHAB 2 - empowering the smart home
   Loaded: loaded (/usr/lib/systemd/system/openhab2.service; disabled)
   Active: active (running) since Thu 2016-10-27 17:27:44 CEST; 4s ago
     Docs: http://docs.openhab.org
           https://community.openhab.org
 Main PID: 954 (karaf)
   CGroup: /system.slice/openhab2.service
           ââ 954 /bin/sh /usr/share/openhab2/runtime/karaf/bin/karaf server
           ââ1068 /usr/bin/java -Dopenhab.home=/usr/share/openhab2 -Dopenhab.conf=/etc/openhab2 -Dopenhab.runtime=/usr/share/openhab2/runtime -Dopenhab.userdata=/var/lib/openhab2 -Dopenhab.logdir=/var/log/openhab2 -Dorg.osgi.servic...

Oct 27 17:27:44 OpenHab2 systemd[1]: Started openHAB 2 - empowering the smart home.
Oct 27 17:27:44 OpenHab2 start.sh[954]: Launching the openHAB runtime...

I’m not so skilled on Linux, but seems that autostart is not executed at boot.

Marco

OK, if that is the only problem the fix is easy.

systemctl enable openhab
6 Likes

Great, it works. Sorry for stupid post, but sometimes is too hard collec the right information.

Thanks

Marco

1 Like

The only stupid posts come from those who refuse to learn and just want us to do everything for them. None of your postings have come anywhere close to that. I’m happy to help.

2 Likes

I’ve got this too:

openhab.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)

But when I try and start OH

sudo systemctl start openhab

I get this:

Failed to start openhab.service: Unit openhab.service failed to load: No such file or directory.

I believe I’ve tried all the stuff recommended on this thread and others.

What else can I do?

(This is with openHabian running on a RPi3)

Thanks!

Only a minor thing, it’s “openhab2”, not just “openhab”.

2 Likes

Oops! That’s a pretty major oversight.

Now I get:

Jul 13 17:23:48 openHABianPi systemd[1]: Started openHAB 2 - empowering the smart home.
Jul 13 17:23:48 openHABianPi start.sh[6132]: Launching the openHAB runtime…
Jul 13 17:23:50 openHABianPi start.sh[6132]: /var/log/openhab2/openhab.log (Permissi…d)
Jul 13 17:23:50 openHABianPi systemd[1]: openhab2.service: main process exited, code…/a
Jul 13 17:23:50 openHABianPi stop[6285]: stop: Ignoring predefined value for KARAF_HOME
Hint: Some lines were ellipsized, use -l to show in full.

Which may be connected with me accidentally deleting the openhab/log file. I created a new one manually. Was this the wrong thing to do?

As long as the folder exists, this should be fine, but to make sure:

chown -R openhab:openhab /var/log/openhab2

See if that helps and try again.

1 Like

Perfect! All working again. Thank you so much.

1 Like