Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > c828a0074e4264561ca0b8e9959b796a > files > 3

keepalived-1.2.13-3.mga5.i586.rpm

#!/bin/sh
#
# Startup script for the Keepalived daemon
#
# processname: keepalived
# pidfile: /var/run/keepalived.pid
# config: /etc/keepalived/keepalived.conf
# chkconfig: 345 21 79
# description: Start and stop Keepalived
#
### BEGIN INIT INFO
# Provides: keepalived
# Default-Start: 3 4 5
# Short-Description: High Availability Monitor
# Description: High Availability Monitor
### END INIT INFO

# Source function library
. /etc/rc.d/init.d/functions

# Source configuration file (we set KEEPALIVED_OPTIONS there)
. /etc/sysconfig/keepalived

RETVAL=0

prog="keepalived"

start() {
    gprintf "Starting %s: " "$prog"
    daemon keepalived ${KEEPALIVED_OPTIONS}
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
}

stop() {
    gprintf "Stopping %s: " "$prog"
    killproc keepalived
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
}

reload() {
    gprintf "Reloading %s: " "$prog"
    killproc keepalived -1
    RETVAL=$?
    echo
}

# See how we were called.
case "$1" in
    start)
        start
        ;;
    stop)
        stop
        ;;
    reload)
        reload
        ;;
    restart)
        stop
        start
        ;;
    condrestart)
        if [ -f /var/lock/subsys/$prog ]; then
            stop
            start
        fi
        ;;
    status)
        status keepalived
        RETVAL=$?
        ;;
    *)
        gprintf "Usage: %s {start|stop|reload|restart|condrestart|status}\n" "$0"
        RETVAL=1
esac

exit $RETVAL