Solved. Problems migrating to openhab2, linux command problems?

hello,

I’m trying to migrate from openhab to openhab2. Openhab 1.7 installation is not that big so no problem dropping it and starting from scratch with openhab2, but I started through official migration guide in http://docs.openhab.org/tutorials/migration.html

All went quite welI got to the point of installing Openhab2, launched it with Openhab-IP:8080 added some bindings, they didn’t find some of my existing devices so I decided to restart my raspberry, but before that I tried to deactivate openhab1 from autostarting. I got some warnings but didn’t read carefully just restarted it. After restart I couldn’t connect to the Openhab-IP:8080 I got:

HTTP ERROR 500
Problem accessing /openhab.app. Reason:
Sitemap 'default' could not be found 

I noticed that Openhab1 and Openhab2 are both running services on my raspberry. Here I must admit I’m still learning Linux commands and it’s hierarchy… I work with original “PI” user and sudo commands I assumed that it’s like admin command but somehow when I try to deactivate the openhab installation with:

sudo systemctl disable openhab.service

I get:

Synchronizing state for openhab.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab defaults
insserv: warning: current start runlevel(s) (empty) of script `openhab' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d openhab disable
insserv: warning: current start runlevel(s) (empty) of script `openhab' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab' overrides LSB defaults (0 1 6).

also not sure if this helps but when installing openhab1 I followed this guide:
[http://www.makeuseof.com/tag/getting-started-openhab-home-automation-raspberry-pi/]

Can someone give me suggestions why I can’t disable openhab1 in update-rc.d I assume that’s the main reason why I can’t access openhab2…

P.s. Openhab1 is running and functioning. Can access it with my mobile phone app haven’t tried anything else as it’s not what I want :slight_smile:

You cannot have openHAB1 and openHAB2 on the same computer …

I don’t want to… When I try to disable openhab1 from auto starting I get warnings as described in previous post. don’t know why and how to disable openhab1…

It depends how you did your autostart setup: with sysvinit (Wheezy) or systemd (Jessie).

sysvinit:
sudo update-rc.d -f openhab remove

systemd:
sudo systemctl disable openhab.service

thank you for this tip I will need to try it. I am 95% sure that I have Jessie, but in the www.makeuseof.com tutorial, that I used for initial openhab installation, I see command:

sudo update-rc.d openhab defaults

that’s very similar what you wrote for Wheezy… can both commands be performed on my system?

Thanks for the tip I will try it this evening and respond what came out…

As far as I know: yes.
You can find the system your server is using via:

sudo stat /proc/1/exe

In Jessie it will answer: -> „/lib/systemd/systemd“

done the:

sudo stat /proc/1/exe

and the answer was: → „/lib/systemd/systemd“

Done following commands:

pi@raspberrypi ~ $ sudo systemctl stop openhab.service
pi@raspberrypi ~ $ sudo update-rc.d -f openhab remove
pi@raspberrypi ~ $ sudo systemctl disable openhab.service
Synchronizing state for openhab.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab defaults
Executing /usr/sbin/update-rc.d openhab disable
insserv: warning: current start runlevel(s) (empty) of script `openhab' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab' overrides LSB defaults (0 1 6).
pi@raspberrypi ~ $

and when I restart the raspberry and do the:

service --status-all

I find both openhab and openhab2 running… any ideas why it wont die… :slight_smile:

No, sorry. My Linux knowledge is not deep enough to solve your problem.

Hello just a heads up if someone would have the same problem…
Not sure why the command line didn’t work, but I looked for the start file manually. Found out that rc.d should be in etc folder, but in my case in there I found only rc.local and in this file I found

sudo systemctl start openhab 

I commented it out manually and now everything works :slight_smile:

thanks for help sihui!

1 Like