While testing the configuration I discovered that the isc-dhcp-server
already uses separate pid and lease files with the "-6" option. Get it
working with a second init script seemed promising and is successful.

Steps

1. Copy /etc/init.d/isc-dhcp-server to /etc/init.d/isc-dhcp6-server .

2. Adjust filenames (config, pid) and dhcpd option in the startup
   script /etc/init.d/isc-dhcp6-server (file isc-dhcp-server.patch is
   attached).

3. Enable it
     systemctl enable isc-dhcp6-server.service # systemd
   or
     update-rc.d isc-dhcp6-server defaults # traditional "rc" startup

4. Create a fresh file /var/lib/dhcp/dhcpd6.leases using
   /var/lib/dhcp/dhcpd.leases as template.

5. Create your /etc/dhcp/dhcpd6.conf

Thanks for your work which made it so easy.


Regards,
      Gero
--- isc-dhcp6-server	2014-08-14 06:57:42.000000000 +0200
+++ isc-dhcp6-server.new	2015-05-17 01:39:12.113661107 +0200
@@ -3,14 +3,14 @@
 #
 
 ### BEGIN INIT INFO
-# Provides:          isc-dhcp-server
+# Provides:          isc-dhcp6-server
 # Required-Start:    $remote_fs $network $syslog
 # Required-Stop:     $remote_fs $network $syslog
 # Should-Start:      $local_fs slapd $named
 # Should-Stop:       $local_fs slapd
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
-# Short-Description: DHCP server
+# Short-Description: DHCPv6 server
 # Description:       Dynamic Host Configuration Protocol Server
 ### END INIT INFO
 
@@ -34,22 +34,22 @@
 # Read init script configuration
 [ -f "$DHCPD_DEFAULT" ] && . "$DHCPD_DEFAULT"
 
-NAME=dhcpd
-DESC="ISC DHCP server"
+NAME=dhcpd6
+DESC="ISC DHCPv6 server"
 # fallback to default config file
-DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd.conf}
+DHCPD_CONF=${DHCPD_CONF:-/etc/dhcp/dhcpd6.conf}
 # try to read pid file name from config file, with fallback to /var/run/dhcpd.pid
 if [ -z "$DHCPD_PID" ]; then
 	DHCPD_PID=$(sed -n -e 's/^[ \t]*pid-file-name[ \t]*"(.*)"[ \t]*;.*$/\1/p' < "$DHCPD_CONF" 2>/dev/null | head -n 1)
 fi
-DHCPD_PID="${DHCPD_PID:-/var/run/dhcpd.pid}"
+DHCPD_PID="${DHCPD_PID:-/var/run/dhcpd6.pid}"
 
 test_config()
 {
-	if ! /usr/sbin/dhcpd -t $OPTIONS -q -cf "$DHCPD_CONF" > /dev/null 2>&1; then
+	if ! /usr/sbin/dhcpd -t $OPTIONS -6 -q -cf "$DHCPD_CONF" > /dev/null 2>&1; then
 		echo "dhcpd self-test failed. Please fix $DHCPD_CONF."
 		echo "The error was: "
-		/usr/sbin/dhcpd -t $OPTIONS -cf "$DHCPD_CONF"
+		/usr/sbin/dhcpd -t $OPTIONS -6 -cf "$DHCPD_CONF"
 		exit 1
 	fi
 	touch /var/lib/dhcp/dhcpd.leases
@@ -77,7 +77,7 @@
 		log_daemon_msg "Starting $DESC" "$NAME"
 		start-stop-daemon --start --quiet --pidfile "$DHCPD_PID" \
 			--exec /usr/sbin/dhcpd -- \
-			-q $OPTIONS -cf "$DHCPD_CONF" -pf "$DHCPD_PID" $INTERFACES
+			-q $OPTIONS -6 -cf "$DHCPD_CONF" -pf "$DHCPD_PID" $INTERFACES
 		sleep 2
 
 		if check_status -q; then

Reply via email to