5 .
/etc
/conf.d
/postgresql84
7 PG_CTL
="/usr/${_PQDIR}/bin/pg_ctl $PGOPTS -D $PGROOT/data -l /var/log/postgresql84.log -s -w"
11 stat_busy
"Starting PostgreSQL 8.4"
13 if [ ! `egrep '^postgres:' /etc/group` ]; then
14 stat_busy
"Adding postgres group"
15 groupadd
-g 88 postgres
18 if [ ! `egrep '^postgres:' /etc/passwd` ]; then
19 stat_busy
"Adding postgres user"
20 useradd
-u 88 -g postgres
-d $PGROOT -s /bin
/bash postgres
21 [ -d $PGROOT ] && chown
-R postgres.postgres
$PGROOT
24 if [ ! -d $PGROOT ]; then
25 mkdir
-p $PGROOT/data
&& chown
-R postgres.postgres
$PGROOT
26 su
- postgres
-c "/usr/${_PQDIR}/bin/initdb $INITOPTS -D $PGROOT/data"
28 if [ ! -e /var
/log
/postgresql84.log
]; then
29 touch /var
/log
/postgresql84.log
30 chown postgres
/var
/log
/postgresql84.log
33 su
- postgres
-c "$PG_CTL start"
37 add_daemon postgresql84
42 stat_busy
"Stopping PostgreSQL 8.4"
43 su
- postgres
-c "$PG_CTL stop -m fast"
47 rm_daemon postgresql84
57 echo "usage: $0 {start|stop|restart}"