4 # Required-Start: $remote_fs $network $syslog
5 # Required-Stop: $network $remote_fs $syslog
6 # Default-Start: 2 3 4 5
8 # Short-Description: LLDP daemon
9 # Description: lldpd is a 802.1AB implementation, a L2 network
10 # discovery protocol. It also supports CDP, EDP and
11 # various other protocols.
16 # PATH should only include /usr/* if it runs after the mountnfs.sh script
17 PATH=/sbin:/usr/sbin:/bin:/usr/bin
20 DAEMON=/usr/sbin/$NAME
22 PIDFILE=/var/run/$NAME.pid
23 SCRIPTNAME=/etc/init.d/$NAME
26 # Exit if the package is not installed
27 [ -x "$DAEMON" ] || exit 0
29 # Read configuration variable file if it is present
30 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
32 # Create the chroot directory if not present
33 [ -d "$CHROOT" ] || mkdir -p $CHROOT
36 . /lib/lsb/init-functions
38 if [ ! -d "$CHROOT" ]; then
45 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
47 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
54 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
56 [ "$RETVAL" = 2 ] && return 2
57 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
58 [ "$?" = 2 ] && return 2
64 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
70 [ "$VERBOSE" != no ] && log_begin_msg "Starting $DESC" "$NAME"
73 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
74 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
78 [ "$VERBOSE" != no ] && log_begin_msg "Stopping $DESC" "$NAME"
81 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
82 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
86 log_begin_msg "Reloading $DESC" "$NAME"
91 log_begin_msg "Restarting $DESC" "$NAME"
98 1) log_end_msg 1 ;; # Old process is still running
99 *) log_end_msg 1 ;; # Failed to start
109 status_of_proc $DAEMON $NAME -p $PIDFILE && exit 0 || exit $?
112 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2