diff options
author | Bruce Momjian | 2001-01-30 17:37:49 +0000 |
---|---|---|
committer | Bruce Momjian | 2001-01-30 17:37:49 +0000 |
commit | ed7910ef44e7089d49dc10e99c928be96c60da04 (patch) | |
tree | 119ebf9810bd97823c115fe7c502501f27ca3e31 /contrib/init.d/postgresql | |
parent | 8255fc17168f2b87e2f83d6518d5b1a204a40d81 (diff) |
Update /contrib README and add init.d from Ryan.
Diffstat (limited to 'contrib/init.d/postgresql')
-rw-r--r-- | contrib/init.d/postgresql | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/contrib/init.d/postgresql b/contrib/init.d/postgresql new file mode 100644 index 00000000000..205ccda4325 --- /dev/null +++ b/contrib/init.d/postgresql @@ -0,0 +1,44 @@ +#! /bin/sh +# +# PostgreSQL Start the pgsql RDMBS. + +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin +DAEMON=/home/postgres/bin/pg_ctl +NAME=postmaster +FILE=postgresql +ARGS="-w -D /home/postgres/data -o -i -o -F" +USER="postgres:postgres" +LOG="/home/postgres/server.log" +DESC="PostgreSQL RDBMS" + +test -f $DAEMON || exit 0 + +set -e + +case "$1" in + start) + echo -n "Starting $DESC: " + su - postgres sh -c "$DAEMON start $ARGS >& $LOG" + echo "$NAME." + ;; + stop) + echo -n "Stopping $DESC: " + su - postgres sh -c "$DAEMON stop >& /dev/null" + echo "$NAME." + ;; + restart) + /etc/init.d/$FILE stop + sleep 5 + /etc/init.d/$FILE start + ;; + status) + su - postgres $DAEMON status + ;; + *) + N=/etc/init.d/$FILE + echo "Usage: $N {start|stop|restart|status}" >&2 + exit 1 + ;; +esac + +exit 0 |