Commit 77cba075 authored by Klaus-Uwe Mitterer's avatar Klaus-Uwe Mitterer

Add systemd service file, move Gunicorn configuration to gunicorn.cfg

parent 3fdef90c
import multiprocessing
name = "PyGPS"
bind = ""
workers = multiprocessing.cpu_count() * 4
Description = PyGPS
After =
PermissionsStartOnly = true
PIDFile = /run/pygps/
User = gps
Group = gps
WorkingDirectory = /opt/pygps
ExecStartPre = /bin/mkdir /run/pygps
ExecStartPre = /bin/chown -R gps:gps /run/pygps
ExecStart = /usr/bin/env gunicorn -c gunicorn.cfg --pid /run/pygps/ main
ExecReload = /bin/kill -s HUP $MAINPID
ExecStop = /bin/kill -s TERM $MAINPID
ExecStopPost = /bin/rm -rf /run/pygps
PrivateTmp = true
WantedBy =
workers=$((`getconf _NPROCESSORS_ONLN` * 4))
gunicorn -w $workers -b $ip:$port -n "GPS Endpoint" main
gunicorn -c gunicorn.cfg main
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment