Browse Source

Adding systemd service file

master
Levi Olson 5 years ago
parent
commit
8bb33f85bf
1 changed files with 29 additions and 0 deletions
  1. +29
    -0
      weather-api.service

+ 29
- 0
weather-api.service View File

@ -0,0 +1,29 @@
[Unit]
Description=Dark Sky Weather API service
ConditionPathExists=/root/go/src/weather-api
After=network.target
[Service]
Type=simple
User=weatherapi
Group=weatherapi
LimitNOFILE=1024
Restart=on-failure
RestartSec=10
startLimitIntervalSec=60
WorkingDirectory=/root/go/src/weather-api
ExecStart=/root/go/src/weather-api/weather-api
# make sure log directory exists and owned by syslog
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/weatherapi
ExecStartPre=/bin/chown syslog:adm /var/log/weatherapi
ExecStartPre=/bin/chmod 755 /var/log/weatherapi
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=weatherapi
[Install]
WantedBy=multi-user.target

Loading…
Cancel
Save