Progmasoft Git

progmaweb

The site and account service of Progmasoft: a Next.js frontend and an ASP.NET Core API.

Clonegit clone https://git.progmasoft.com/progmaweb

Treat intentional Next.js shutdown as successful

Teach systemd that the Node runtime's SIGTERM exit status is an expected graceful stop. This prevents routine atomic deployments from leaving a misleading failed result after the replacement service is already healthy.
Commit
96699b883c12e079451c9a754da185cf1e26b3fe
Author
Leitwolf11 ·
Parents
41b6d47bd69e

Files · Download .tar.gz

Changes

 ops/systemd/progmaweb-web.service | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ops/systemd/progmaweb-web.service b/ops/systemd/progmaweb-web.service
index 0bcdf5d..acf4690 100644
--- a/ops/systemd/progmaweb-web.service
+++ b/ops/systemd/progmaweb-web.service
@@ -20,6 +20,10 @@ Environment=PROGMAWEB_API_ORIGIN=http://127.0.0.1:5085
 Restart=on-failure
 RestartSec=5s
 TimeoutStopSec=30s
+# Node reports SIGTERM as status 143 during an intentional systemd stop. Treat
+# that graceful shutdown as success so deployments do not leave a false failed
+# result in the service history.
+SuccessExitStatus=143
 
 # Standalone Next.js only reads immutable release files and opens its loopback listener.
 NoNewPrivileges=true