[Unit] Description=subdap ldap frontend application server After=network.target [Service] PIDFile=/var/subdap/gunicorn.pid User=subdap Group=subdap WorkingDirectory=/var/subdap/src Environment=VIRTUAL_ENV="/var/subdap/venv" Environment=PATH="$VIRTUAL_ENV/bin:$PATH" ExecStart=/var/subdap/venv/bin/gunicorn \ --pid /var/subdap/gunicorn.pid \ --log-syslog \ --max-requests 1000 \ -w 10 -t 120 \ -b 127.0.0.1:8001 \ index ExecReload=/bin/kill -HUP $MAINPID ExecStop=/bin/kill -TERM $MAINPID Restart=on-failure [Install] WantedBy=multi-user.target