4 # description: Starts and stops the clustered tdb daemon
6 # pidfile: /var/run/ctdbd/ctdbd.pid
8 # Source function library.
9 if [ -f /etc/init.d/functions ] ; then
10 . /etc/init.d/functions
11 elif [ -f /etc/rc.d/init.d/functions ] ; then
12 . /etc/rc.d/init.d/functions
17 # Avoid using root's TMPDIR
20 # Source networking configuration.
21 . /etc/sysconfig/network
25 # pull in admin specified config
26 if [ -f /etc/sysconfig/ctdb ]; then
30 # Check that networking is up.
31 [ ${NETWORKING} = "no" ] && exit 0
33 # build up CTDB_OPTIONS variable
34 [ -z "$LOGFILE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --logfile=$LOGFILE"
35 [ -z "$NODES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --nlist=$NODES"
36 [ -z "$CTDB_SOCKET" ] || CTDB_OPTIONS="$CTDB_OPTIONS --socket=$CTDB_SOCKET"
37 [ -z "$PUBLIC_ADDRESSES" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-addresses=$PUBLIC_ADDRESSES"
38 [ -z "$PUBLIC_INTERFACE" ] || CTDB_OPTIONS="$CTDB_OPTIONS --public-interface=$PUBLIC_INTERFACE"
39 [ -z "$DBDIR" ] || CTDB_OPTIONS="$CTDB_OPTIONS --dbdir=$DBDIR"
40 [ -z "$EVENT_SCRIPT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --event-script $EVENT_SCRIPT"
41 [ -z "$TRANSPORT" ] || CTDB_OPTIONS="$CTDB_OPTIONS --transport $TRANSPORT"
42 [ -z "$DEBUGLEVEL" ] || CTDB_OPTIONS="$CTDB_OPTIONS -d $DEBUGLEVEL"
45 echo -n $"Starting ctdbd services: "
46 daemon ctdbd $CTDB_OPTIONS
49 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ctdb || \
55 echo -n $"Shutting down ctdbd services: "
59 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ctdb
71 if [ $? -ne 0 ] ; then
77 # Allow status as non-root.
78 if [ "$1" = status ]; then
97 [ -f /var/lock/subsys/ctdb ] && restart || :
100 echo $"Usage: $0 {start|stop|restart|status|condrestart}"