[SOLVED] Openhab2 not starting after apt-get update = solved

Interesting, the usual way to start openHAB on the RPi is to use the following command:

sudo systemctl start openhab2.service

However, it looks as though the openhab2.service file is out of date. I’m not sure how this is possible though, because it gets updated with each apt upgrade… What does sudo systemctl status openhab2.service tell you? Does it contain the following line:

Loaded: loaded (/usr/lib/systemd/system/openhab2.service; ...

If so, does the file loaded contain:

[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]
Environment=OPENHAB_HOME=/usr/share/openhab2
Environment=OPENHAB_CONF=/etc/openhab2
Environment=OPENHAB_RUNTIME=/usr/share/openhab2/runtime
Environment=OPENHAB_USERDATA=/var/lib/openhab2
Environment=OPENHAB_LOGDIR=/var/log/openhab2
Environment=OPENHAB_STARTMODE=daemon
EnvironmentFile=-/etc/default/openhab2

User=openhab
Group=openhab

WorkingDirectory=/usr/share/openhab2
ExecStart=/usr/share/openhab2/runtime/bin/karaf $OPENHAB_STARTMODE
ExecStop=/usr/share/openhab2/runtime/bin/karaf stop

SuccessExitStatus=0 143
RestartSec=5
Restart=on-failure
TimeoutStopSec=120

LimitNOFILE=102642

[Install]
WantedBy=multi-user.target

If it does contain the information, then you need to reset the service file:

sudo systemctl daemon-reload
sudo systemctl restart openhab2