3 # postgresql This is the init script for starting up the PostgreSQL
8 # description: Starts and stops the PostgreSQL backend daemon that handles \
9 # all database requests.
11 # processname: postmaster
12 # pidfile: /var/run/postmaster.pid
15 # Source function library
16 . /etc/rc.d/init.d/functions
19 . /etc/sysconfig/network
22 [ -f /etc/sysconfig/postgresql ] && . /etc/sysconfig/postgresql
24 # Check that networking is up.
25 [ "${NETWORKING}" = "no" ] && echo "Error: Networking is down"; exit 0
28 [ -f /tmp/.s.PGSQL.5432 ] || rm -f /tmp/.s.PGSQL.5432
31 # See how we were called.
34 # Check if the service is already running?
35 if [ ! -f /var/lock/subsys/postgresql ]; then
36 show Starting postgresql
38 su postgres -c '/usr/bin/postmaster
39 touch /var/lock/subsys/postgresql
43 echo "Postgresql already is running"
45 touch /var/lock/subsys/postgresql
48 show Stopping postgresql service
51 rm -f /var/run/postmaster.pid
52 rm -f /var/lock/subsys/postgresql
62 echo "Usage: postgresql {start|stop|status|restart|reload}"