Running OH2 as service?

Hello,

I’m migrating from OH2 on ubuntu (running under VMWARE) towards OH2 on centos7 (running under /Proxmox).

Everything is starting to run, expect one small detail:

  • When I start it with /opt/openhab2/start.sh, everything runs fine.
  • When I put this in a script to start at reboot, it runs, but I can’t connect to the server with the GUI’s?
  • When I put this in a system script (see below), and enable it, it runs, but again, I can’t connect with the GUI’s?

It’s like I can only run in the foreground? Any ideas, suggestions?

cat /usr/lib/systemd/system/openhab2.service

[Unit] 
Description=The openHAB 2 Home Automation Bus Solution
Documentation=http://docs.openhab.org
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=openhab
Group=openhab
GuessMainPID=yes
WorkingDirectory=/opt/openhab2
ExecStart=/opt/openhab2/start.sh server
ExecStop=/bin/kill -SIGINT $MAINPID
Restart=on-failure

[Install]
WantedBy=multi-user.target

ps the installation I’ve done is trough ZIP-file (openhab-2.1.0-SNAPSHOT.zip). Seems that yum isn’t possible, yet…

Seems that I had an issue with the user/group openhab. There was fe a conflict to write into the log files.
After giving the user openhab the proper rights, the service runs fine.