Created
November 10, 2024 00:19
-
-
Save Xowap/ff31058a808ecf93922277ed8905927e to your computer and use it in GitHub Desktop.
Django with systemd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=xxx gunicorn server | |
Requires=xxx.socket | |
After=network.target | |
[Service] | |
User=www-data | |
Group=www-data | |
EnvironmentFile=/var/apps/xxx/env | |
WorkingDirectory=/var/apps/xxx/ | |
PermissionsStartOnly=true | |
ExecStartPre=/bin/mkdir -p /run/felix | |
ExecStartPre=/bin/chmod 1777 /run/felix | |
PIDFile=/run/felix/xxx.pid | |
ExecStart=/var/apps/_virtualenvs/xxx/bin/gunicorn --pid /run/felix/xxx.pid --log-file - --threads 10 xxx.wsgi | |
ExecReload=/bin/kill -s HUP $MAINPID | |
ExecStop=/bin/kill -s TERM $MAINPID | |
Restart=always | |
RestartSec=1 | |
PrivateTmp=true | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=xxx socket | |
[Socket] | |
ListenStream=/run/felix/sockets/xxx.socket | |
[Install] | |
WantedBy=sockets.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment