#!/bin/sh # This shell script takes care of starting and stopping dhcpd (DHCPv6). # # chkconfig: - 65 35 # description: \ # The Internet Software Consortium DHCPv6 Server, dhcpd, implements \ # the Dynamic Host Configuration Protocol for IPv6 (DHCPv6) and the Internet \ # Bootstrap Protocol (BOOTP). DHCPv6 allows hosts on a TCP/IP network \ # to request and be assigned IPv6 addresses, and also to discover \ # information about the network to which they are attached. BOOTP \ # provides similar functionality, with certain restrictions. # processname: dhcpd # config: /etc/dhcp/dhcpd6.conf # pidfile: /var/run/dhcpd6.pid WITHOUT_RC_COMPAT=1 # Source function library. . /etc/init.d/functions # Source networking configuration. SourceIfNotEmpty /etc/sysconfig/network PIDFILE=/var/run/dhcpd6.pid DHCPD_CONF=/etc/dhcp/dhcpd6.conf DHCPD_CONF_SAMPLE=/etc/dhcp/dhcpd6.conf.sample LOCKFILE=/var/lock/subsys/dhcpd6 # Source config. SourceIfNotEmpty /etc/sysconfig/dhcpd6 RETVAL=0 start() { is_yes "$NETWORKING" || return 0 if [ -e "$DHCPD_CONF" ]; then action "Adjusting environment for dhcpd (DHCPv6):" /etc/chroot.d/dhcpd6.all ||: start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user dhcpd6 \ --displayname "dhcpd (DHCPv6)" -- dhcpd -6 $DHCPDARGS RETVAL=$? else msg_starting "dhcpd (DHCPv6)" printf "%s: %s" "$DHCPD_CONF" "No such file or directory" failure "dhcpd (DHCPv6) startup" echo if [ -e "$DHCPD_CONF_SAMPLE" ]; then echo "There is a sample configuration file under $DHCPD_CONF_SAMPLE" >&2 fi RETVAL=1 fi return $RETVAL } stop() { stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user dhcpd6 \ --displayname "dhcpd (DHCPv6)" -- dhcpd RETVAL=$? return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload|restart) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condreload|condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; status) status --pidfile "$PIDFILE" --expect-user dhcpd6 --displayname "dhcpd (DHCPv6)" -- dhcpd RETVAL=$? ;; *) msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}" RETVAL=1 esac exit $RETVAL