Better examples

Signed-off-by: fbt <fbt@fleshless.org>
This commit is contained in:
2026-11-27 16:14:30 +00:00
parent fd658f7545
commit f74df5962e
11 changed files with 152 additions and 25 deletions
+19 -5
View File
@@ -1,8 +1,22 @@
#!/usr/bin/env ssm
service_respawn = on-failure
service_command = /usr/bin/nginx
service_pidfile = /run/nginx.pid
# nginx web server.
#
# nginx daemonizes itself (the parent returns after handing off to
# workers), so we don't wait for the process to exit — we wait for the
# port instead.
# Do not reload the service if the config test fails.
pre_reload() { "$service_command" -t "$@"; }
service_respawn = on-failure
service_command = /usr/sbin/nginx
service_pidfile = /run/nginx.pid
service_pidfile_timeout = 10
# ngs sometimes takes a moment to bind; poll until the socket answers.
ready() {
(exec 3<>/dev/tcp/127.0.0.1/80) 2>/dev/null
}
# Do not send the reload signal if the config doesn't parse.
pre_reload() {
"$service_command" -t
}