deploy scripts
This commit is contained in:
@@ -4,10 +4,8 @@
|
||||
# keeps the :7777 socket open, boots new workers on the new code, then
|
||||
# gracefully stops the old ones - no downtime. See deploy/systemd/deploy.sh.
|
||||
#
|
||||
# Install:
|
||||
# sudo cp deploy/systemd/polylan-submitter.service /etc/systemd/system/
|
||||
# sudo systemctl daemon-reload
|
||||
# sudo systemctl restart polylan-submitter # first switch from daphne needs a full restart
|
||||
# Installed to /etc/systemd/system/ by deploy.sh: when this file changed it
|
||||
# does daemon-reload + a full restart (HUP keeps the old ExecStart args).
|
||||
|
||||
[Unit]
|
||||
Description=PolyLAN submitter (gunicorn + uvicorn workers)
|
||||
@@ -15,10 +13,12 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=caddy
|
||||
Group=caddy
|
||||
Restart=always
|
||||
RestartSec=1
|
||||
User=root
|
||||
WorkingDirectory=/home/caddy/polylan-submitter/polylan_submitter
|
||||
# EnvironmentFile=/home/caddy/polylan-submitter/.env
|
||||
# Relative to WorkingDirectory, loaded by settings.py via python-dotenv.
|
||||
Environment="SETTINGS_ENV_FILE_LOCATION=polylan_submitter/.env"
|
||||
|
||||
# No --preload: with it, HUP re-forks from the already imported (old) code.
|
||||
# --forwarded-allow-ips replaces daphne's --proxy-headers: trust
|
||||
@@ -34,8 +34,6 @@ ExecReload=/bin/kill -s HUP $MAINPID
|
||||
# SIGTERM to the master only, it then drains its workers (graceful-timeout).
|
||||
KillMode=mixed
|
||||
TimeoutStopSec=30
|
||||
Restart=on-failure
|
||||
RestartSec=2
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
Reference in New Issue
Block a user