-
Notifications
You must be signed in to change notification settings - Fork 199
Run as service on linux (systemd)
BWS Systems edited this page Jul 30, 2019
·
2 revisions
The following steps describe, how to set up habridge as a service on a linux system with systemd (for example debian).
- create script
sudo vi /etc/systemd/system/habridge.service
contents (in this example it is already installed on /home/myuser/habridge):
[Unit]
Description=HA Bridge
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
WorkingDirectory=/home/myuser/habridge
ExecStart=/usr/bin/java -jar -Dconfig.file=/home/myuser/habridge/data/habridge.config -Dserver.port=80 /home/myuser/habridge/ha-bridge-5.1.0.jar
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
- reload services
sudo systemctl daemon-reload
- Enable the service
sudo systemctl enable habridge
- Start the service
sudo systemctl start habridge
- Check the status of your service
sudo systemctl status habridge