Files
ssm/examples/services/postgres
T
fbt f74df5962e Better examples
Signed-off-by: fbt <fbt@fleshless.org>
2026-11-27 16:14:30 +00:00

19 lines
583 B
Plaintext

#!/usr/bin/env ssm
# PostgreSQL.
#
# postgres writes its own postmaster.pid file, so ssm doesn't create one
# — instead it waits for the pidfile to appear and treats any process
# exit as a failure. This is how services with their own pidfile should
# be written.
service_respawn = on-failure
service_command = /usr/lib/postgresql/17/bin/postgres -D /var/lib/postgresql/data
service_pidfile = /var/lib/postgresql/data/postmaster.pid
service_pidfile_timeout = 30
# Wait for the server to actually accept connections.
ready() {
(exec 3<>/dev/tcp/127.0.0.1/5432) 2>/dev/null
}