]> git.ipfire.org Git - thirdparty/lldpd.git/blob - redhat/lldpd.init.suse
redhat: mark /var/run stuff as a ghost directory
[thirdparty/lldpd.git] / redhat / lldpd.init.suse
1 #!/bin/sh
2
3 ### BEGIN INIT INFO
4 # Provides: lldpd
5 # Required-Start: $local_fs $remote_fs
6 # Required-Stop: $local_fs $remote_fs
7 # Should-Start: $syslog $network $net-snmp
8 # Should-Stop: $syslog $network $net-snmp
9 # Default-Start: 3 5
10 # Default-Stop: 0 1 2 6
11 # Short-Description: LLDP daemon
12 # Description: 802.1ab (LLDP) daemon
13 ### END INIT INFO
14
15
16 # Check for missing binaries (stale symlinks should not happen)
17 # Note: Special treatment of stop for LSB conformance
18 LLDPD_BIN=/usr/sbin/lldpd
19 test -x $LLDPD_BIN || { echo "$LLDPD_BIN not installed";
20 if [ "$1" = "stop" ]; then exit 0;
21 else exit 5; fi; }
22
23 # Check for existence of needed config file and read it
24 LLDPD_CONFIG=/etc/sysconfig/lldpd
25 test -r $LLDPD_CONFIG || { echo "$LLDPD_CONFIG not existing";
26 if [ "$1" = "stop" ]; then exit 0;
27 else exit 6; fi; }
28
29 # Read config
30 . $LLDPD_CONFIG
31
32 . /etc/rc.status
33
34 # Reset status of this service
35 rc_reset
36
37 case "$1" in
38 start)
39 echo -n "Starting lldpd "
40 /sbin/startproc $LLDPD_BIN
41 rc_status -v
42 ;;
43 stop)
44 echo -n "Shutting down lldpd "
45 /sbin/killproc -TERM $LLDPD_BIN
46 rc_status -v
47 ;;
48 try-restart|condrestart)
49 $0 status
50 if test $? = 0; then
51 $0 restart
52 else
53 rc_reset # Not running is not a failure.
54 fi
55 rc_status
56 ;;
57 restart)
58 $0 stop
59 $0 start
60
61 rc_status
62 ;;
63 force-reload)
64 $0 try-restart
65 rc_status
66 ;;
67 reload)
68 # Does not support reload
69 rc_failed 3
70 rc_status -v
71 ;;
72 status)
73 echo -n "Checking for service lldpd "
74 /sbin/checkproc $LLDPD_BIN
75 rc_status -v
76 ;;
77 probe)
78 ;;
79 *)
80 echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
81 exit 1
82 ;;
83 esac
84 rc_exit
85