Web lists-archives.com

RE: dhcp restart with bad config




Hello Liam and list,

>> 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
>> [....]
>>
>> Is there any way to get the old functionality back?
>
> You could port the script segments you identified to the jessie version of
> the init file. But first I would consult the changelog from the wheezy to 
> the jessie versions (especially with regard to system migration) to see
> if there is a better way.

The funny thing is, the init script is still there, with the correct segments but using it has the same result. 
It almost looks like the command gets intercepted by systemd and the script is not executed.
There is the strange fact that it seems the config is tested twice but I guess systemd will try to start a service twice before giving up. At least I get the same behavior when I simply try to start the service with the config error after stopping it normally.

Is there any way to have the proper execution of the script back?
If I need to file this as a bug, against which package do I need to file it?

Test results:

12:16 Error created in dhcp config file
Then explicitly calling the init script
  # /etc/init.d/isc-dhcp-server restart
Result onscreen is:
[....] Restarting isc-dhcp-server (via systemctl): isc-dhcp-server.serviceJob for isc-dhcp-server.service failed. See 'systemctl status isc-dhcp-server.service' and 'journalctl -xn' for details.
 failed!

In the SYSLOG
Aug 30 12:16:19 linein dhcpd: DHCPACK on 172.16.214.168 to 8c:f5:a3:50:fa:2e (Galaxy-S6) via 172.16.212.1
Aug 30 12:16:34 linein systemd[1]: Stopping LSB: DHCP server...
Aug 30 12:16:34 linein isc-dhcp-server[24040]: Stopping ISC DHCP server: dhcpd.
Aug 30 12:16:34 linein systemd[1]: Starting LSB: DHCP server...
Aug 30 12:16:34 linein dhcpd: /etc/dhcp/dhcpd.conf line 1: semicolon expected.
Aug 30 12:16:34 linein dhcpd: Dit is
Aug 30 12:16:34 linein dhcpd:      ^
Aug 30 12:16:34 linein dhcpd: Configuration file errors encountered -- exiting
Aug 30 12:16:34 linein dhcpd:
Aug 30 12:16:34 linein dhcpd: If you think you have received this message due to a bug rather
Aug 30 12:16:34 linein dhcpd: than a configuration issue please read the section on submitting
Aug 30 12:16:34 linein dhcpd: bugs on either our web page at www.isc.org or in the README file
Aug 30 12:16:34 linein dhcpd: before submitting a bug.  These pages explain the proper
Aug 30 12:16:34 linein dhcpd: process and the information we find helpful for debugging..
Aug 30 12:16:34 linein dhcpd:
Aug 30 12:16:34 linein dhcpd: exiting.
Aug 30 12:16:34 linein isc-dhcp-server[24047]: dhcpd self-test failed. Please fix /etc/dhcp/dhcpd.conf.
Aug 30 12:16:34 linein isc-dhcp-server[24047]: The error was:
Aug 30 12:16:34 linein dhcpd: Internet Systems Consortium DHCP Server 4.3.1
Aug 30 12:16:34 linein isc-dhcp-server[24047]: Internet Systems Consortium DHCP Server 4.3.1
Aug 30 12:16:34 linein dhcpd: Copyright 2004-2014 Internet Systems Consortium.
Aug 30 12:16:34 linein isc-dhcp-server[24047]: Copyright 2004-2014 Internet Systems Consortium.
Aug 30 12:16:34 linein dhcpd: All rights reserved.
Aug 30 12:16:34 linein isc-dhcp-server[24047]: All rights reserved.
Aug 30 12:16:34 linein dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Aug 30 12:16:34 linein isc-dhcp-server[24047]: For info, please visit https://www.isc.org/software/dhcp/
Aug 30 12:16:34 linein dhcpd: Config file: /etc/dhcp/dhcpd.conf
Aug 30 12:16:34 linein isc-dhcp-server[24047]: Config file: /etc/dhcp/dhcpd.conf
Aug 30 12:16:34 linein dhcpd: Database file: /var/lib/dhcp/dhcpd.leases
Aug 30 12:16:34 linein dhcpd: PID file: /var/run/dhcpd.pid
Aug 30 12:16:34 linein dhcpd: /etc/dhcp/dhcpd.conf line 1: semicolon expected.
Aug 30 12:16:34 linein dhcpd: Dit is
Aug 30 12:16:34 linein dhcpd:      ^
Aug 30 12:16:34 linein isc-dhcp-server[24047]: Database file: /var/lib/dhcp/dhcpd.leases
Aug 30 12:16:34 linein isc-dhcp-server[24047]: PID file: /var/run/dhcpd.pid
Aug 30 12:16:34 linein isc-dhcp-server[24047]: /etc/dhcp/dhcpd.conf line 1: semicolon expected.
Aug 30 12:16:34 linein isc-dhcp-server[24047]: Dit is
Aug 30 12:16:34 linein isc-dhcp-server[24047]: ^
Aug 30 12:16:34 linein dhcpd: Configuration file errors encountered -- exiting
Aug 30 12:16:34 linein isc-dhcp-server[24047]: Configuration file errors encountered -- exiting
Aug 30 12:16:34 linein dhcpd:
Aug 30 12:16:34 linein dhcpd: If you think you have received this message due to a bug rather
Aug 30 12:16:34 linein isc-dhcp-server[24047]: If you think you have received this message due to a bug rather
Aug 30 12:16:34 linein dhcpd: than a configuration issue please read the section on submitting
Aug 30 12:16:34 linein isc-dhcp-server[24047]: than a configuration issue please read the section on submitting
Aug 30 12:16:34 linein dhcpd: bugs on either our web page at www.isc.org or in the README file
Aug 30 12:16:34 linein isc-dhcp-server[24047]: bugs on either our web page at www.isc.org or in the README file
Aug 30 12:16:34 linein dhcpd: before submitting a bug.  These pages explain the proper
Aug 30 12:16:34 linein dhcpd: process and the information we find helpful for debugging..
Aug 30 12:16:34 linein dhcpd:
Aug 30 12:16:34 linein dhcpd: exiting.
Aug 30 12:16:34 linein systemd[1]: isc-dhcp-server.service: control process exited, code=exited status=1
Aug 30 12:16:34 linein systemd[1]: Failed to start LSB: DHCP server.
Aug 30 12:16:34 linein systemd[1]: Unit isc-dhcp-server.service entered failed state.
Aug 30 12:16:34 linein isc-dhcp-server[24047]: before submitting a bug.  These pages explain the proper
Aug 30 12:16:34 linein isc-dhcp-server[24047]: process and the information we find helpful for debugging..
Aug 30 12:16:34 linein isc-dhcp-server[24047]: exiting.
Aug 30 12:17:01 linein CRON[24076]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

12:20 Correct file restored
# service isc-dhcp-server restart
In SYSLOG
Aug 30 12:17:01 linein CRON[24076]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Aug 30 12:20:29 linein systemd[1]: Starting LSB: DHCP server...
Aug 30 12:20:29 linein dhcpd: Wrote 0 class decls to leases file.
Aug 30 12:20:29 linein dhcpd: Wrote 0 deleted host decls to leases file.
Aug 30 12:20:29 linein dhcpd: Wrote 0 new dynamic host decls to leases file.
Aug 30 12:20:29 linein dhcpd: Wrote 641 leases to leases file.
Aug 30 12:20:29 linein dhcpd: Server starting service.
Aug 30 12:20:29 linein dhcpd: DHCPINFORM from 172.16.213.160 via 172.16.212.1
Aug 30 12:20:29 linein dhcpd: DHCPACK to 172.16.213.160 (8c:dc:d4:4a:72:cb) via eth0
Aug 30 12:20:31 linein isc-dhcp-server[25397]: Starting ISC DHCP server: dhcpd.
Aug 30 12:20:31 linein systemd[1]: Started LSB: DHCP server.
Aug 30 12:20:34 linein dhcpd: DHCPDISCOVER from 58:c5:cb:58:8a:a9 (android-a4a8b22c312e06c0) via 172.16.212.1
Aug 30 12:20:35 linein dhcpd: DHCPDISCOVER from 04:4b:ed:6f:2a:e6 via 172.16.212.1

Bonno Bloksma