switch to s6-rc
This commit is contained in:
parent
5103f5b01f
commit
05459d3577
16 changed files with 31 additions and 20 deletions
9
rootfs/bin/db-password
Executable file
9
rootfs/bin/db-password
Executable 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
5
rootfs/bin/initdb
Executable 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
|
|
@ -1,5 +0,0 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
|
||||
if [ ! -f ${PGDATA}/PG_VERSION ]; then
|
||||
s6-setuidgid postgres initdb --username=postgres
|
||||
fi
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
/var/lib/postgresql true postgres 0600 0700
|
2
rootfs/etc/s6-overlay/s6-rc.d/confd/dependencies
Normal file
2
rootfs/etc/s6-overlay/s6-rc.d/confd/dependencies
Normal file
|
@ -0,0 +1,2 @@
|
|||
initdb
|
||||
db-password
|
1
rootfs/etc/s6-overlay/s6-rc.d/db-password/dependencies
Normal file
1
rootfs/etc/s6-overlay/s6-rc.d/db-password/dependencies
Normal file
|
@ -0,0 +1 @@
|
|||
initdb
|
1
rootfs/etc/s6-overlay/s6-rc.d/db-password/type
Normal file
1
rootfs/etc/s6-overlay/s6-rc.d/db-password/type
Normal file
|
@ -0,0 +1 @@
|
|||
oneshot
|
1
rootfs/etc/s6-overlay/s6-rc.d/db-password/up
Normal file
1
rootfs/etc/s6-overlay/s6-rc.d/db-password/up
Normal file
|
@ -0,0 +1 @@
|
|||
s6-setuidgid postgres db-password
|
1
rootfs/etc/s6-overlay/s6-rc.d/initdb/type
Normal file
1
rootfs/etc/s6-overlay/s6-rc.d/initdb/type
Normal file
|
@ -0,0 +1 @@
|
|||
oneshot
|
1
rootfs/etc/s6-overlay/s6-rc.d/initdb/up
Normal file
1
rootfs/etc/s6-overlay/s6-rc.d/initdb/up
Normal file
|
@ -0,0 +1 @@
|
|||
s6-setuidgid postgres initdb
|
3
rootfs/etc/s6-overlay/s6-rc.d/postgres/dependencies
Normal file
3
rootfs/etc/s6-overlay/s6-rc.d/postgres/dependencies
Normal file
|
@ -0,0 +1,3 @@
|
|||
initdb
|
||||
db-password
|
||||
confd
|
2
rootfs/etc/services.d/postgres/run → rootfs/etc/s6-overlay/s6-rc.d/postgres/run
Executable file → Normal file
2
rootfs/etc/services.d/postgres/run → rootfs/etc/s6-overlay/s6-rc.d/postgres/run
Executable file → Normal file
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/with-contenv sh
|
||||
#!/command/with-contenv sh
|
||||
|
||||
exec s6-setuidgid postgres postgres \
|
||||
-D $PGDATA \
|
1
rootfs/etc/s6-overlay/s6-rc.d/postgres/type
Normal file
1
rootfs/etc/s6-overlay/s6-rc.d/postgres/type
Normal file
|
@ -0,0 +1 @@
|
|||
longrun
|
0
rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/postgres
Normal file
0
rootfs/etc/s6-overlay/s6-rc.d/user/contents.d/postgres
Normal file
Loading…
Add table
Add a link
Reference in a new issue