5 # description: DHCP IPv6 Server
7 # Source function library
8 . /etc/rc.d/init.d/functions
11 . /etc/sysconfig/network
13 # Check that networking is up.
14 if ! is_yes "${IPV6_NETWORKING}"; then
19 [ -f /etc/sysconfig/dhcpd ] && . /etc/sysconfig/dhcpd
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
22 msg_network_down "DHCP IPv6 Server"
29 if LC_ALL=C ip addr show dev $DEVICE | grep -q inet6; then
39 /sbin/dhcpd -6 -pf /var/run/dhpcd6.pid -q -t -T || rc=$?
41 # check if interfaces specified exist and have addresses
42 for i in $DHCPD_INTERFACES; do
43 if ! check_device_up $i; then
44 echo >&2 "Device '$i' does not exist or has no address configured"
52 # wrapper for configtest
57 # run checkconfig only once
58 if [ "$checkconfig" != -1 ]; then
62 if [ $details = 1 ]; then
63 # run config test and display report (status action)
64 show "Checking %s configuration" "DHCP IPv6 Server"; busy
66 out=$(configtest 2>&1)
68 if [ $checkconfig = 0 ]; then
73 [ "$out" ] && echo >&2 "$out"
76 # run config test and abort with nice message if failed
77 # (for actions checking status before action).
78 configtest >/dev/null 2>&1
80 if [ $checkconfig != 0 ]; then
81 show "Checking %s configuration" "DHCP IPv6 Server"; fail
82 nls 'Configuration test failed. See details with %s "checkconfig"' $0
89 # Check if the service is already running?
90 if [ -f /var/lock/subsys/dhcpd6 ]; then
91 msg_already_running "DHCP IPv6 Server"
96 msg_starting "DHCP IPv6 Server"
97 daemon /sbin/dhcpd -6 -pf /var/run/dhpcd6.pid -q $DHCPD_INTERFACES
99 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcpd6
103 if [ ! -f /var/lock/subsys/dhcpd6 ]; then
104 msg_not_running "DHCP IPv6 Server"
108 msg_stopping "DHCP IPv6 Server"
109 killproc --pidfile /var/run/dhcpd6.pid dhcpd
110 rm -f /var/run/dhcpd6.pid /var/lock/subsys/dhcpd6 >/dev/null 2>&1
114 if [ ! -f /var/lock/subsys/dhcpd6 ]; then
115 msg_not_running "DHCP IPv6 Server"
126 # See how we were called.
145 checkconfig|configtest)
149 status --pidfile /var/run/dhcpd6.pid dhcpd6 dhcpd
153 msg_usage "$0 {start|stop|restart|try-restart|force-reload|checkconfig|status}"