Hello
I had a working installation of OH2, until some apt-get update.
Tried to remove everything, and freshly install, to no avail.
Current situation is:
Right, I think I see something unusual though. You mentioned that you used apt-get to update?
Your service file is pointing to start openHAB using /etc/init.d/openhab2 but there’s a predefined service file that does a much better job at running openHAB using systemd. Is there any reason why this is different to default (/usr/lib/systemd/system/openhab2.service)?
If you want to use openHAB’s defaults, We can try resetting systemd’s expectations, is the user:group responsible for openHAB openhab:openhab or have you changed this too? From this information, I should be able to give you a few commands to help diagnose the problem.
Hi Benji, and thanks for following (let alone so promptly!)
I don’t mind purging OH2 completely, and reinstalling if it makes things easy.
I tried to do in in the past by apt-get remove openhab2, then find any file mentioned openhab2 and rename to xxx-old
Now I don’t have any file called /usr/lib/systemd/system/openhab2.service (Only the old version)
I am using Debian 8.1
I use openhab:openhab for the user:group.
I did what you suggest in the last post:
root@storage:/home/dorish# systemctl disable openhab2
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
Executing /usr/sbin/update-rc.d openhab2 disable
insserv: warning: current start runlevel(s) (empty) of script `openhab2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab2' overrides LSB defaults (0 1 6).
root@storage:/home/dorish# systemctl enable openhab2.service
Synchronizing state for openhab2.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d openhab2 defaults
insserv: warning: current start runlevel(s) (empty) of script `openhab2' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `openhab2' overrides LSB defaults (0 1 6).
Executing /usr/sbin/update-rc.d openhab2 enable
root@storage:/home/dorish# systemctl start openhab2.service
root@storage:/home/dorish#
root@storage:/home/dorish#
root@storage:/home/dorish# systemctl status openhab2.service
â—Ź openhab2.service - LSB: openHAB2 server
Loaded: loaded (/etc/init.d/openhab2)
Active: active (exited) since Thu 2017-07-13 14:31:41 IDT; 8h ago
Jul 13 14:31:41 storage openhab2[9812]: Starting openHAB2 server: openhab2.
Jul 13 14:31:41 storage systemd[1]: Started LSB: openHAB2 server.
Jul 13 22:49:02 storage systemd[1]: Started LSB: openHAB2 server.
root@storage:/home/dorish#
root@storage:/home/dorish# ssh -p 8101 openhab@localhost
ssh: connect to host localhost port 8101: Connection refused
root@storage:/home/dorish# netstat -a | grep 8080
root@storage:/home/dorish#
Hi @dorish, not a problem. To give you an insight into whats happening, the service deamon is trying to pick /etc/init.d/openhab because openhab2 does not exist. The file has not been reapplied because it’s trying to keep your choice (renaming it).
I would suggest recreating /usr/lib/systemd/system/openhab2.service by renaming the old file back to normal, or by creating a new one with the following contents (how they were at openHAB 2.1):
[Unit]
Description=openHAB 2 - empowering the smart home
Documentation=http://docs.openhab.org
Documentation=https://community.openhab.org
Wants=network-online.target
After=network-online.target
[Service]
EnvironmentFile=/etc/default/openhab2
User=openhab
Group=openhab
WorkingDirectory=/usr/share/openhab2
#PermissionsStartOnly=true
#ExecStartPre=/usr/share/openhab/bin/setpermissions.sh
ExecStart=/usr/share/openhab2/start.sh server
ExecStop=/usr/share/openhab2/runtime/bin/stop
# Shutdown delay in seconds, before process is tried to be killed with KILL (if configured)
TimeoutStopSec=120
Restart=on-failure
[Install]
WantedBy=multi-user.target
Then, try the three commands again, but with an extra one too:
If this does not work, I would strongly suggest backing up /var/lib/openhab2 and /etc/openhab2 first and then sudo apt-get purge openhab2 which will delete everything. When you’re running with a new system, make sure you replace the entirety of /etc/openhab with what you had, and then the place back everything from /var/lib/openhab2except:
Ok. Pasted your file’s content, did the 3 magic lines, now my house can think again
I swear I’m not drunk, yet had to apt-get purge twice (!)
Thanks for the responsiveness.
Dorish