switch to s6-rc

This commit is contained in:
Sebastian Hugentobler 2022-02-13 08:23:50 +01:00
parent 5103f5b01f
commit 05459d3577
Signed by: shu
GPG key ID: BB32CF3CA052C2F0
16 changed files with 31 additions and 20 deletions

9
rootfs/bin/db-password Executable file
View file

@ -0,0 +1,9 @@
#!/command/with-contenv sh
echo "local all all trust" > "$PGDATA/pg_hba.conf"
pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w start
psql --command "ALTER USER postgres WITH PASSWORD '${POSTGRES_PASSWORD}';"
pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w stop

5
rootfs/bin/initdb Executable file
View file

@ -0,0 +1,5 @@
#!/command/with-contenv sh
if [ ! -f "/var/lib/postgresql/data/PG_VERSION" ]; then
s6-setuidgid postgres initdb --username=postgres
fi

View file

@ -1,5 +0,0 @@
#!/usr/bin/with-contenv sh
if [ ! -f ${PGDATA}/PG_VERSION ]; then
s6-setuidgid postgres initdb --username=postgres
fi

View file

@ -1,11 +0,0 @@
#!/usr/bin/with-contenv sh
cat <<EOF > /var/lib/postgresql/data/pg_hba.conf
local all all trust
EOF
s6-setuidgid postgres pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w start
s6-setuidgid postgres psql --command "ALTER USER postgres WITH PASSWORD '${POSTGRES_PASSWORD}';"
s6-setuidgid postgres pg_ctl -D "$PGDATA" -o "-c listen_addresses='localhost'" -w stop

View file

@ -1 +0,0 @@
/var/lib/postgresql true postgres 0600 0700

View file

@ -0,0 +1,2 @@
initdb
db-password

View file

@ -0,0 +1 @@
initdb

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
s6-setuidgid postgres db-password

View file

@ -0,0 +1 @@
oneshot

View file

@ -0,0 +1 @@
s6-setuidgid postgres initdb

View file

@ -0,0 +1,3 @@
initdb
db-password
confd

View file

@ -1,4 +1,4 @@
#!/usr/bin/with-contenv sh
#!/command/with-contenv sh
exec s6-setuidgid postgres postgres \
-D $PGDATA \

View file

@ -0,0 +1 @@
longrun