2 ############################
3 # main event script for ctdb
5 # This script is called with one of the following sets of arguments
6 # startup : called when ctdb starts
7 # shutdown : called when ctdb shuts down
8 # takeip : called when an IP address is taken over
9 # releaseip : called when an IP address is released
10 # recovered : called when ctdb has finished a recovery event
12 . $CTDB_BASE/functions
15 # ensure we have /bin and /usr/bin in the path
16 PATH=/bin:/usr/bin:$PATH
23 # make sure we have a blank state directory for the scripts to work with
24 /bin/rm -rf $CTDB_BASE/state
25 /bin/mkdir -p $CTDB_BASE/state
27 # set any tunables from the config file
28 set | grep ^CTDB_SET_ | cut -d_ -f3- |
30 varname=`echo $v | cut -d= -f1`
31 value=`echo $v | cut -d= -f2`
32 ctdb setvar $varname $value || exit 1
33 echo "`date` Set $varname to $value"