Blame SOURCES/lldpd-el6.init

2260e0
#!/bin/bash
2260e0
# lldpd init file
2260e0
#
2260e0
# chkconfig: - 60 20
2260e0
# description: 802.1ab (LLDP) daemon
2260e0
#
2260e0
# processname: lldpd
2260e0
# pidfile: /var/run/lldpd.pid
2260e0
2260e0
### BEGIN INIT INFO
2260e0
# Provides: lldpd
2260e0
# Required-Start: $local_fs $remote_fs
2260e0
# Required-Stop: $local_fs $remote_fs
2260e0
# Should-Start: $syslog $network $net-snmp
2260e0
# Should-Stop: $syslog $network $net-snmp
2260e0
# Default-Stop: 0 1 6
2260e0
# Short-Description: LLDP daemon
2260e0
# Description: 802.1ab (LLDP) daemon
2260e0
### END INIT INFO
2260e0
2260e0
# source function library
2260e0
. /etc/rc.d/init.d/functions
2260e0
2260e0
exec="/usr/sbin/lldpd"
2260e0
prog="lldpd"
2260e0
config="/etc/lldpd.d"
2260e0
2260e0
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
2260e0
2260e0
lockfile=/var/lock/subsys/$prog
2260e0
2260e0
start() {
2260e0
    [ -x $exec ] || exit 4
2260e0
    [ -d $config ] || exit 6
2260e0
    echo -n $"Starting $prog: "
2260e0
    daemon $exec $LLDPD_OPTIONS
2260e0
    retval=$?
2260e0
    echo
2260e0
    [ $retval -eq 0 ] && touch $lockfile
2260e0
    return $retval
2260e0
}
2260e0
2260e0
stop() {
2260e0
    echo -n $"Stopping $prog: "
2260e0
    killproc $exec
2260e0
    retval=$?
2260e0
    echo
2260e0
    [ $retval -eq 0 ] && rm -f $lockfile
2260e0
    return $RETVAL
2260e0
}
2260e0
2260e0
restart() {
2260e0
    stop
2260e0
    start
2260e0
}
2260e0
2260e0
reload() {
2260e0
    restart
2260e0
}
2260e0
2260e0
force_reload() {
2260e0
    restart
2260e0
}
2260e0
2260e0
rh_status() {
2260e0
    # run checks to determine if the service is running or use generic status
2260e0
    status $prog
2260e0
}
2260e0
2260e0
rh_status_q() {
2260e0
    rh_status >/dev/null 2>&1
2260e0
}
2260e0
2260e0
case "$1" in
2260e0
    start)
2260e0
        rh_status_q && exit 0
2260e0
        $1
2260e0
        ;;
2260e0
    stop)
2260e0
        rh_status_q || exit 0
2260e0
        $1
2260e0
        ;;
2260e0
    restart)
2260e0
        $1
2260e0
        ;;
2260e0
    reload)
2260e0
        rh_status_q || exit 7
2260e0
        $1
2260e0
        ;;
2260e0
    force-reload)
2260e0
        force_reload
2260e0
        ;;
2260e0
    status)
2260e0
        rh_status
2260e0
        ;;
2260e0
    condrestart|try-restart)
2260e0
        rh_status_q || exit 0
2260e0
        restart
2260e0
        ;;
2260e0
    *)
2260e0
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
2260e0
        exit 2
2260e0
esac
2260e0
exit $?