Web lists-archives.com

dhcp restart with bad config


Today I had a small (big?) problem with the DHCP server.
When I make any changes I allways do a
# service isc-dhcp-server restart
to test the new config. In the past when there was an error in the config the service would keep running using the previous config.
This was achieved by doing a config test before the service stop.

On my old Wheezy machine the /etc/init.d/isc-dhcp-server file has the segment(s)
        if ! /usr/sbin/dhcpd -t $OPTIONS -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"
                exit 1
restart | force-reload)
                $0 stop
                sleep 2
                $0 start
                if [ "$?" != "0" ]; then
                        exit 1
Where a failed test_config will result in stopping the restart.

On my Jessie DHCP servers this safeguard no longer seems to be present.
After a typo in the config my DHCP server stopped and did not come up until I fixed the typo and (re)started the service. Which took a while as I got disturbed and the change was not urgent and I assumed the service was still running :-(

Is there any way to get the old functionality back?

Bonno Bloksma