3 # slony1 This shell script starts and stops Slony-I processes.
5 # chkconfig: 2345 80 30
6 # description: Slony-I is a replication daemon for PostgreSQL databases.
8 # pidfile: /var/run/slony1.pid
10 # Source function library.
11 . /etc/rc.d/init.d/functions
13 # Source networking configuration.
14 . /etc/sysconfig/network
16 # Source slony1 configureation.
17 . /etc/sysconfig/slony1
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22 msg_network_down Slony-I
30 # See how we were called.
34 if [ ! -f /var/lock/subsys/slony1 ]; then
35 for CLUSTER in $SLONY1_CLUSTERS; do
36 msg_starting "Slony-I ($CLUSTER)"
37 CONNSTRING=`eval echo '$SLONY1_CONNECT'_$CLUSTER`
38 /usr/bin/setsid su - slony1 -c "initlog -c \"slon $CLUSTER '$CONNSTRING'\""
41 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/slony1
43 msg_already_running "Slony-I"
48 if [ -f /var/lock/subsys/slony1 ]; then
49 msg_stopping "Slony-I"
51 rm -f /var/lock/subsys/slony1 >/dev/null 2>&1
53 msg_not_running "Slony-I"
66 if [ -f /var/lock/subsys/slony1 ]; then
67 msg_reloading "Slony-I"
71 msg_not_running "Slony-I" >&2
76 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"