]> git.pld-linux.org Git - packages/postgresql.git/blame - postgresql.init
- added using CVS keywords in %changelog (for automating them).
[packages/postgresql.git] / postgresql.init
CommitLineData
d29ea5e3 1#! /bin/sh
2# postgresql This is the init script for starting up the PostgreSQL
3# server
4#
5# chkconfig: 345 85 15
6# description: Starts and stops the PostgreSQL backend daemon that handles \
7# all database requests.
8# processname: postmaster
9# pidfile: /var/run/postmaster.pid
10#
11
12# Source function library.
13. /etc/rc.d/init.d/functions
14
15# Get config.
16. /etc/sysconfig/network
17
18# Check that networking is up.
19# Pretty much need it for postmaster.
fee0bd40 20[ "${NETWORKING}" = "no" ] && exit 0
d29ea5e3 21
22[ -f /usr/bin/postmaster ] || exit 0
23
24[ -f /tmp/.s.PGSQL.5432 ] || rm -f /tmp/.s.PGSQL.5432
25
26# This script is slightly unusual in that the name of the daemon (postmaster)
27# is not the same as the name of the subsystem (postgresql)
28
29# See how we were called.
30case "$1" in
31 start)
32 show Starting postgresql service
33 busy
34 su postgres -c '/usr/bin/postmaster -S -D/var/lib/pgsql'
35 sleep 1
36 pid=`pidof postmaster`
37 touch /var/lock/subsys/postgresql
38 echo $pid > /var/run/postmaster.pid
39 deltext; ok
40 ;;
41 stop)
42 show Stopping postgresql service
43 killproc postmaster
44 sleep 2
45 rm -f /var/run/postmaster.pid
46 rm -f /var/lock/subsys/postgresql
47 ;;
48 status)
49 status postmaster
50 ;;
51 restart)
52 $0 stop
53 $0 start
54 ;;
55 *)
56 echo "Usage: postgresql {start|stop|status|restart}"
57 exit 1
58esac
59
60exit 0
This page took 0.037975 seconds and 4 git commands to generate.