I have added a second dhcpd for DHCPv6 with symlinking /etc/init.d/dhcpd6 to /etc/init.d/dhcpd and specifying appropriate options in /etc/conf.d/dhcpd6. When testing different configs I notices that /etc/init.d/dhcpd6 configtest does not check against the configuration file specified in /etc/conf.d/dhcpd6 but against /etc/dhcp/dhcpd.conf. Looking at the init script I noticed that configtest does not get the correct config path like start does. Reproducible: Always Steps to Reproduce: 1. create a correct dhcp configuration at /etc/dhcp/dhcpd.conf 2. create a broken dhcp configuration at /etc/dhcp/dhcpd_broken.conf 3. configure dhcp to use the second configuration with DHCPD_CONF=/etc/dhcp/dhcpd_broken.conf in /etc/conf.d/dhcpd 4. run /etc/init.d/dhcpd configtest Actual Results: configtest reports no errors because it checks against /etc/dhcp/dhcpd.conf Expected Results: configtest should report error in /etc/dhcp/dhcpd_broken.conf For a fix I copied the block that extracts the config path from function start to function configtest: configtest() { local chroot=${DHCPD_CHROOT%/} # Work out our cffile if it's in our DHCPD_OPTS case " ${DHCPD_OPTS} " in *" -cf "*) DHCPD_CONF=" ${DHCPD_OPTS} " DHCPD_CONF="${DHCPD_CONF##* -cf }" DHCPD_CONF="${DHCPD_CONF%% *}" ;; *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}" ;; esac if [ -n "${chroot}" ] ; then # the config test want's these to exist mkdir -p \ "${chroot}"/var/run/dhcp \ "${chroot}"/var/lib/dhcp \ "${chroot}"/etc/dhcp fi # see comment in get_var() above if [ ! -f "${chroot}${DHCPD_CONF}" ] ; then eerror "${chroot}${DHCPD_CONF} does not exist" return 1 fi ebegin "Checking ${SVCNAME} configuration" checkconfig eend $? }
should be all set now in the tree; thanks for the report! Commit message: Unify DHCPD_xxx var set up between start and configtest http://sources.gentoo.org/net-misc/dhcp/files/dhcpd.init5?r1=1.6&r2=1.7