Skip to content

Instantly share code, notes, and snippets.

@enko
Created June 7, 2016 20:58
Show Gist options
  • Save enko/2eb67b82d0dd3422ca33e37c7b62941a to your computer and use it in GitHub Desktop.
Save enko/2eb67b82d0dd3422ca33e37c7b62941a to your computer and use it in GitHub Desktop.
#
# A systemd service definition for partuniverse
#
[Unit]
Description=partuniverse service definition
Requires=nginx.service partuniverse.socket
Before=nginx.service
After=network.target
[Service]
PIDFile=/run/partuniverse/pid
User=partuniverse
Group=partuniverse
WorkingDirectory=/home/partuniverse/partuniverse/partuniverse
ExecStart=/home/partuniverse/partuniverse/partuniverse/bin/gunicorn --pid /run/partuniverse/pid partuniverse.wsgi:application --bind 127.0.0.1:8005
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID
PermissionsStartOnly=true
ExecStartPre=-/bin/mkdir /run/partuniverse
ExecStartPre=/bin/chown -R partuniverse:partuniverse /run/partuniverse
[Install]
# When should this service be triggered? (this is the equivalent of SysV's runlevel 3)
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment