5
# Required-Start: $syslog $remote_fs $network
6
# Required-Stop: $syslog $remote_fs $network
7
# Default-Start: 2 3 4 5
9
# Short-Description: Router Advertising Daemon
12
PATH=/sbin:/bin:/usr/sbin:/usr/bin
13
DAEMON=/usr/sbin/radvd
16
CONFIG=/etc/radvd.conf
18
PIDFILE=$PIDDIR/radvd.pid
19
OPTIONS="-u radvd -p $PIDFILE"
20
PROC_SYS_IP6_FORWARDING=/proc/sys/net/ipv6/conf/all/forwarding
22
. /lib/lsb/init-functions
24
test -x $DAEMON || exit 0
28
# Check for IPv6 support in kernel
29
if [ "$(uname -s)" != "GNU/kFreeBSD" ]; then
30
if test \! -e /proc/sys/net/ipv6; then
31
echo "IPv6 support must be enabled in the kernel for $DESC to work."
37
if [ "$(uname -s)" != "GNU/kFreeBSD" ]; then
38
if [ ! -e $CONFIG -o ! -s $CONFIG ]; then
40
echo "* $CONFIG does not exist or is empty."
41
echo "* See /usr/share/doc/radvd/README.Debian"
42
echo "* radvd will *not* be started."
44
elif [ ! -e $PROC_SYS_IP6_FORWARDING -o \
45
"$(cat $PROC_SYS_IP6_FORWARDING)" = "0" ]; then
47
echo "* IPv6 forwarding seems to be disabled."
48
echo "* See /usr/share/doc/radvd/README.Debian"
49
echo "* radvd will *not* be started."
57
echo -n "Starting $DESC: "
60
# Anything under /var/run can go away on reboot
61
[ -e $PIDDIR ] || install -d -o radvd -g root -m 4755 $PIDDIR
63
if ! start-stop-daemon --oknodo --start --pidfile $PIDFILE \
64
--exec $DAEMON -- $OPTIONS; then
65
echo "failed." && exit 1
70
echo -n "Stopping $DESC: "
71
start-stop-daemon --oknodo --stop --pidfile $PIDFILE \
76
echo "Reloading $DESC configuration files."
77
start-stop-daemon --stop --signal HUP --quiet --pidfile \
78
$PIDFILE --exec $DAEMON
81
invoke-rc.d $NAME stop
82
invoke-rc.d $NAME start
85
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
89
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2