5 .
/etc
/conf.d
/postgresql
9 stat_busy
"Starting PostgreSQL"
11 if [ ! `egrep '^postgres:' /etc/group` ]; then
12 stat_busy
"Adding postgres group"
13 groupadd
-g 88 postgres
16 if [ ! `egrep '^postgres:' /etc/passwd` ]; then
17 stat_busy
"Adding postgres user"
18 useradd
-u 88 -g postgres
-d $PGROOT -s /bin
/bash postgres
19 [ -d $PGROOT ] && chown
-R postgres.postgres
$PGROOT
22 if [ ! -d $PGROOT ]; then
23 mkdir
-p $PGROOT/data
&& chown postgres.postgres
$PGROOT/data
24 su
- postgres
-c "/usr/bin/initdb -D $PGROOT/data --locale $LOCALE"
26 if [ ! -e /var
/log
/postgresql.log
]; then
27 touch /var
/log
/postgresql.log
28 chown postgres
/var
/log
/postgresql.log
32 "/usr/bin/pg_ctl -D $PGROOT/data -l /var/log/postgresql.log -W start"
41 stat_busy
"Stopping PostgreSQL"
43 "/usr/bin/pg_ctl -D $PGROOT/data -l /var/log/postgresql.log -w stop"
57 echo "usage: $0 {start|stop|restart}"