Files
spinifex/scripts/images/rds-postgres/rds-init.initd
T
2026-07-29 10:38:22 +10:00

25 lines
817 B
Plaintext

#!/sbin/openrc-run
# rds-init — boot oneshot that bootstraps or attaches the PostgreSQL cluster
# before the engine starts.
#
# `before postgresql` rather than a dependency of it: the engine runs with
# auto_setup="no", so a failure here leaves postgresql refusing to start rather
# than silently creating an empty cluster. `after rds-agent`, not `need`, so a
# failed fetch fails this oneshot visibly rather than skipping it.
description="Spinifex RDS PostgreSQL bootstrap"
depend() {
need net
after rds-agent
before postgresql
}
start() {
ebegin "Bootstrapping the RDS PostgreSQL instance"
# The VM has no operator login, so the host-side serial log is the only view
# of a bootstrap that failed before the engine came up.
/usr/local/sbin/rds-init > /dev/console 2>&1
eend $?
}