3 ##############################
4 # init info for redhat distros
6 # description: Starts and stops the clustered tdb daemon
7 # pidfile: /var/run/ctdbd/ctdbd.pid
8 ##############################
10 ##############################
11 # SLES/OpenSuSE init info
14 # Required-Start: $network
18 # Description: initscript for the ctdb service
21 # Source function library.
22 if [ -f /etc/init.d/functions ] ; then
23 . /etc/init.d/functions
24 elif [ -f /etc/rc.d/init.d/functions ] ; then
25 . /etc/rc.d/init.d/functions
28 [ -f /etc/rc.status ] && {
34 # Avoid using root's TMPDIR
41 # check networking is up (for redhat)
42 [ ${NETWORKING} = "no" ] && exit 0
46 [ -z "$CTDB_RECOVERY_LOCK" ] && {
47 echo "You must configure the location of the CTDB_RECOVERY_LOCK"
50 CTDB_OPTIONS="$CTDB_OPTIONS --reclock=$CTDB_RECOVERY_LOCK"
52 # build up CTDB_OPTIONS variable from optional parameters
53 [ -z "$LOGFILE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --logfile=$LOGFILE"
54 [ -z "$NODES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --nlist=$NODES"
55 [ -z "$CTDB_SOCKET" ] || CTDB_OPTIONS="$CTDB_OPTIONS --socket=$CTDB_SOCKET"
56 [ -z "$PUBLIC_ADDRESSES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-addresses=$PUBLIC_ADDRESSES"
57 [ -z "$PUBLIC_INTERFACE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-interface=$PUBLIC_INTERFACE"
58 [ -z "$DBDIR" ] || CTDB_OPTIONS="$CTDB_OPTIONS --dbdir=$DBDIR"
59 [ -z "$EVENT_SCRIPT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --event-script $EVENT_SCRIPT"
60 [ -z "$TRANSPORT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --transport $TRANSPORT"
61 [ -z "$DEBUGLEVEL" ] || CTDB_OPTIONS="$CTDB_OPTIONS -d $DEBUGLEVEL"
63 if [ -x /sbin/startproc ]; then
65 else if [ -x /sbin/start-stop-daemon ]; then
74 echo -n $"Starting ctdbd service: "
77 startproc /usr/sbin/ctdbd $CTDB_OPTIONS
81 daemon ctdbd $CTDB_OPTIONS
84 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || RETVAL=1
88 start-stop-daemon --start --quiet --background --exec /usr/sbin/ctdbd -- $CTDB_OPTIONS
95 echo -n $"Shutting down ctdbd service: "
104 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ctdb
135 ctdb status > /dev/null && restart || :
138 # used from cron to auto-restart ctdb
139 ctdb status > /dev/null || restart
142 echo $"Usage: $0 {start|stop|restart|status|cron|condrestart}"