mirror of https://github.com/postgres/postgres
parent
8255fc1716
commit
ed7910ef44
@ -0,0 +1,8 @@ |
|||||||
|
postgresql -> This is a Linux distribution independent (or so I |
||||||
|
hope) init.d/rc.d script that makes use of pg_ctl. There is currently a |
||||||
|
few in ./contrib/linux of the pgsql source tree, but they are RedHat |
||||||
|
specific. This one is simple and self contained. |
||||||
|
|
||||||
|
--------------------------------------------------------------------------- |
||||||
|
| Ryan Kirkpatrick | Boulder, Colorado | http://www.rkirkpat.net/ | |
||||||
|
--------------------------------------------------------------------------- |
@ -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 |
Loading…
Reference in new issue