@@ -0,0 +1,34 @@
|
||||
[Unit]
|
||||
# Description is a human-readable name for the service.
|
||||
Description=Gardomatic API service
|
||||
|
||||
# Wait until PostgreSQL is running and the network is "up" before starting the service.
|
||||
After=postgresql.service
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
# Configure service start rate limiting. If the service is (re)started more than 5 times
|
||||
# in 600 seconds then don't permit it to start anymore.
|
||||
StartLimitIntervalSec=600
|
||||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
# Execute the API binary as the gardomatic user, loading its dedicated environment file
|
||||
# and using its writable state directory.
|
||||
Type=exec
|
||||
User=gardomatic
|
||||
Group=gardomatic
|
||||
EnvironmentFile=/etc/gardomatic/gardomatic.env
|
||||
WorkingDirectory=/var/lib/gardomatic
|
||||
ExecStart=/usr/local/bin/gardomatic-api
|
||||
|
||||
# Automatically restart the service after a 5-second wait if it exits with a non-zero
|
||||
# exit code. If it restarts more than 5 times in 600 seconds, then the rate limit we
|
||||
# configured above will be hit and it won't be restarted anymore.
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
[Install]
|
||||
# Start the service automatically at boot time (the 'multi-user.target' describes a boot
|
||||
# state when the system will accept logins).
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user