2015-12-19 15:23:34 +01:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
USER=postgres
|
|
|
|
HOME=/var/pgsql/data
|
|
|
|
GROUP=postgres
|
|
|
|
ID=42
|
|
|
|
|
2021-08-13 01:58:15 +02:00
|
|
|
getent group $GROUP >/dev/null || groupadd -g $ID -r $GROUP
|
|
|
|
getent passwd $USER >/dev/null || useradd -u $ID -d $HOME -g $GROUP -s /bin/false $USER
|
2015-12-19 15:23:34 +01:00
|
|
|
|
2021-08-13 01:58:15 +02:00
|
|
|
test -d $HOME && exit 0
|
2016-03-18 23:11:58 +01:00
|
|
|
|
2021-08-13 01:58:15 +02:00
|
|
|
install -d -o $USER -g $GROUP $HOME
|
|
|
|
su -s /bin/sh -c "pg_ctl -D $HOME initdb" $USER
|
2015-12-19 15:23:34 +01:00
|
|
|
|