updated on Wed Jan 18 16:10:53 UTC 2012
[aur-mirror.git] / slony1 / slon
blob1b96aad7a16c55519d1cf33af25751d80ac83b00
1 #!/bin/bash
3 # source application-specific settings
4 [ -f /etc/conf.d/slon ] && . /etc/conf.d/slon
6 . /etc/rc.conf
7 . /etc/rc.d/functions
9 PID=`pidof -o %PPID /usr/bin/slon`
11 case "$1" in
12 start)
13 stat_busy "Starting Slony-I Replication daemon"
14 [ -z "$PID" ] && /usr/bin/slon_start --config /etc/slon_tools.conf $NODE_NAME
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon slon
19 stat_done
22 stop)
23 stat_busy "Stopping Slony-I Replication daemon"
24 [ ! -z "$PID" ] && /usr/bin/slon_kill --config /etc/slon_tools.conf
25 if [ $? -gt 0 ]; then
26 stat_fail
27 else
28 rm_daemon slon
29 stat_done
32 restart)
33 $0 stop
34 sleep 1
35 $0 start
38 echo "usage: $0 {start|stop|restart}"
40 esac
42 exit 0