diff options
author | root <root@rshg047.dnsready.net> | 2011-04-27 22:24:53 +0000 |
---|---|---|
committer | root <root@rshg047.dnsready.net> | 2011-04-27 22:24:53 +0000 |
commit | 18d6577d511b9a1ac36eaae50060133a401e42a3 (patch) | |
tree | f681f9444a7a0a95916de40af82d3b805d5fb8d3 /extra/postgresql/postgresql | |
parent | 69e1fada8bdc9588d0a3d8bc3403fa809d809a84 (diff) |
Wed Apr 27 22:24:53 UTC 2011
Diffstat (limited to 'extra/postgresql/postgresql')
-rwxr-xr-x | extra/postgresql/postgresql | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/extra/postgresql/postgresql b/extra/postgresql/postgresql index 3a8bf44f8..0fbe94036 100755 --- a/extra/postgresql/postgresql +++ b/extra/postgresql/postgresql @@ -9,26 +9,26 @@ PGROOT=${PGROOT:-/var/lib/postgres} PG_CTL="/usr/bin/pg_ctl -D $PGROOT/data -l /var/log/postgresql.log -s -w" postgres_init() { - # initialization - if [ ! -d $PGROOT/data ]; then - mkdir -p $PGROOT/data && chown -R postgres:postgres $PGROOT - su - postgres -c "/usr/bin/initdb $INITOPTS -D $PGROOT/data" - fi - if [ ! -e /var/log/postgresql.log ]; then - touch /var/log/postgresql.log - chown postgres /var/log/postgresql.log - fi + # initialization + if [ ! -d $PGROOT/data ]; then + mkdir -p $PGROOT/data && chown -R postgres:postgres $PGROOT + su - postgres -c "/usr/bin/initdb $INITOPTS -D $PGROOT/data" + fi + if [ ! -e /var/log/postgresql.log ]; then + touch /var/log/postgresql.log + chown postgres /var/log/postgresql.log + fi } case "$1" in start) - postgres_init + postgres_init stat_busy "Starting PostgreSQL" su - postgres -c \ "$PG_CTL start" if [ $? -gt 0 ]; then stat_fail - exit 1 + exit 1 else add_daemon postgresql stat_done @@ -51,19 +51,19 @@ case "$1" in "$PG_CTL reload" if [ $? -gt 0 ]; then stat_fail - exit 1 + exit 1 else stat_done fi ;; restart) - postgres_init + postgres_init stat_busy "Restarting PostgreSQL" su - postgres -c \ "$PG_CTL restart -m fast" if [ $? -gt 0 ]; then stat_fail - exit 1 + exit 1 else add_daemon postgresql stat_done |