Skip to content

Instantly share code, notes, and snippets.

@jordic
Created December 14, 2016 12:21
Show Gist options
  • Save jordic/b5a85c91a81935a5d196aa1b114536e3 to your computer and use it in GitHub Desktop.
Save jordic/b5a85c91a81935a5d196aa1b114536e3 to your computer and use it in GitHub Desktop.
/etc/systemd/system/gunicorn.service:
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
PIDFile=/run/gunicorn/pid
User=someuser
Group=someuser
WorkingDirectory=/home/someuser
ExecStart=/home/someuser/gunicorn/bin/gunicorn --pid /run/gunicorn/pid test:app
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment