Private
Public Access
install.sh: actually restart services when their unit files change
systemctl enable --now only starts a service if it's stopped — on a re-run where a unit file's ExecStart changed (e.g. picking up a new EVECTION_GUNICORN_BIND), the already-running process just kept running on its old command line indefinitely. This is exactly what happened switching gunicorn from a Unix socket to TCP: the new unit file was written and daemon-reload'd, but gunicorn itself never restarted, so it kept listening on the old socket. Restart explicitly instead of relying on --now. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
21c33e8188
commit
2068df471f
1 file changed
+6
-1
+6
-1
@@ -201,7 +201,12 @@ for unit in evection-gunicorn evection-celery-worker evection-celery-beat; do
|
||||
"$APP_DIR/docs/deploy/${unit}.service" > "/etc/systemd/system/${unit}.service"
|
||||
done
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now evection-gunicorn evection-celery-worker evection-celery-beat
|
||||
systemctl enable evection-gunicorn evection-celery-worker evection-celery-beat
|
||||
# Not "enable --now": that only starts a service if it's stopped, so a
|
||||
# re-run after a unit file changed (e.g. a new EVECTION_GUNICORN_BIND)
|
||||
# would reload the daemon but leave the already-running process on its
|
||||
# stale old ExecStart indefinitely. Always restart explicitly instead.
|
||||
systemctl restart evection-gunicorn evection-celery-worker evection-celery-beat
|
||||
|
||||
echo
|
||||
echo "==> Services installed. Checking status..."
|
||||
|
||||
Reference in new issue
Block a user