I'm having some issues with my init.d scripts for slony. I have three
different clusters and init scripts for each of them. When running I see
each daemon has two processes, such as:
postgres 13894 1 0 10:06 ? 00:00:00 /usr/bin/slony1-cluster1
-f /etc/slony1-cluster1.conf
postgres 16149 13894 0 10:13 ? 00:00:00 /usr/bin/slony1-
cluster1 -f /etc/slony1-cluster1.conf
postgres 13774 1 0 10:06 ? 00:00:00 /usr/bin/slony1-
cluster2 -f /etc/slony1-cluster2.conf
postgres 13776 13774 0 10:06 ? 00:00:00 /usr/bin/slony1-
cluster2 -f /etc/slony1-cluster2.conf
/usr/bin/slony1-cluster1 and /usr/bin/slony1-cluster2 are symlinks to
/usr/bin/slony1
In the init scripts, if I run 'killproc /usr/bin/slony1' for the stop
function then both daemons are getting shut down. If I try 'killproc -p
/path/to/slony1-cluster1.pid then one of the slony1-cluster1 processes
gets terminated, but the other hangs around and seems to respawn the
first. Looking for suggestions. Here's my current stop and start code:
start(){
SLON_START=$"Starting ${NAME} service: "
echo -n "$SLON_START"
$SU -l postgres -c "$SLONDAEMON -f $SLONCONF &" >> "$SLONLOG"
2>&1 < /dev/null
sleep 2
pid=`pidof -s "$SLONDAEMON"`
if [ $pid ]
then
success "$SLON_START"
touch /var/lock/subsys/${NAME}
echo $pid > $SLONPID
echo
else
failure "$SLON_START"
echo
script_result=1
fi
}
stop(){
echo -n $"Stopping ${NAME} service: "
if [ $UID -ne 0 ]; then
RETVAL=1
failure
else
killproc -p $SLONPID $SLONDAEMON
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${NAME}
fi;
echo
return $RETVAL
}
_______________________________________________
Slony1-general mailing list
[email protected]
http://lists.slony.info/mailman/listinfo/slony1-general