Skip to content

Commit

Permalink
When starting and stopping ctdb through the init-script, make sure we…
Browse files Browse the repository at this point in the history
… first clear all public ips bvefore we start the daemon, in case they are still hanging around since a previous kill -9 and also make sure we drop them after we have stopped the deamon when shutting down

CQ S1027550

(This used to be ctdb commit 8de5513b3ad89711da845c7588d35b32e2f2acb6)
  • Loading branch information
sahlberg committed Aug 11, 2011
1 parent 21226ee commit 53b956f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions ctdb/config/ctdb.init
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,16 @@ wait_until_ready () {

ctdbd=${CTDBD:-/usr/sbin/ctdbd}

drop_all_public_ips() {
[ -z "$CTDB_PUBLIC_ADDRESSES" ] && {
return
}

cat $CTDB_PUBLIC_ADDRESSES | while read IP IFACE REST; do
ip addr del $IP dev $IFACE >/dev/null 2>/dev/null
done
}

start() {
echo -n $"Starting ctdbd service: "

Expand All @@ -225,6 +235,10 @@ start() {

build_ctdb_options

# make sure we drop any ips that might still be held if previous
# instance of ctdb got killed with -9 or similar
drop_all_public_ips

check_persistent_databases || return $?

if [ "$CTDB_SUPPRESS_COREFILE" = "yes" ]; then
Expand Down Expand Up @@ -305,6 +319,9 @@ stop() {
pkill -9 -f $CTDB_BASE/events.d/
}
done
# make sure all ips are dropped, pfkill -9 might leave them hanging around
drop_all_public_ips

case $init_style in
suse)
# re-set the return code to the recorded RETVAL in order
Expand All @@ -318,6 +335,7 @@ stop() {
echo ""
;;
esac

return $RETVAL
}

Expand Down

0 comments on commit 53b956f

Please sign in to comment.