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 if [ "${NETWORKING}" = "no" ]; then
26 echo "WARNING: Networking is down. Postgresql service can't be runed."
31 [ -f /tmp/.s.PGSQL.5432 ] || rm -f /tmp/.s.PGSQL.5432
34 # See how we were called.
37 # Check if the service is already running?
38 if [ ! -f /var/lock/subsys/postgresql ]; then
39 show Starting postgresql
41 su postgres -c '/usr/bin/postmaster
42 touch /var/lock/subsys/postgresql
46 echo "Postgresql already is running"
48 touch /var/lock/subsys/postgresql
51 show Stopping postgresql service
54 rm -f /var/run/postmaster.pid
55 rm -f /var/lock/subsys/postgresql
65 echo "Usage: postgresql {start|stop|status|restart|reload}"