From 2068df471f090a3c8528bd5710d78b7296a0bc78 Mon Sep 17 00:00:00 2001 From: Keith Smith Date: Sat, 31 Oct 2026 09:05:46 -0600 Subject: [PATCH] install.sh: actually restart services when their unit files change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- scripts/install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 2d40ab3..dbfa38f 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -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..."