5 .
/etc
/conf.d
/postgresql
7 # Default PGROOT if it wasn't defined in the conf.d file
8 PGROOT
=${PGROOT:-/var/lib/postgres}
9 PG_CTL
="/usr/bin/pg_ctl -D $PGROOT/data -l /var/log/postgresql.log -s -w"
13 if [ ! -d $PGROOT/data
]; then
14 mkdir
-p $PGROOT/data
&& chown
-R postgres
:postgres
$PGROOT
15 su
- postgres
-c "/usr/bin/initdb $INITOPTS -D $PGROOT/data"
17 if [ ! -e /var
/log
/postgresql.log
]; then
18 touch /var
/log
/postgresql.log
19 chown postgres
/var
/log
/postgresql.log
26 stat_busy
"Starting PostgreSQL"
38 stat_busy
"Stopping PostgreSQL"
40 "$PG_CTL stop -m fast"
49 stat_busy
"Reloading PostgreSQL"
61 stat_busy
"Restarting PostgreSQL"
63 "$PG_CTL restart -m fast"
73 stat_busy
"Checking PostgreSQL status";
77 echo "usage: $0 {start|stop|reload|restart|status}"