Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 259364

Summary: [PATCH] net-misc/dhcp doesn't test config in init.d script
Product: Gentoo Linux Reporter: Arturas <arturas>
Component: Current packagesAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: patch for dhcpd.init file in portage

Description Arturas 2009-02-17 15:03:54 UTC
dhcpd init.d script doesn't test config using dhcpd -t command. When using scripted dhcpd.conf and dhcpd stop start, dhcpd can stop running on error. Some distros are using configtest before stop and start, I think gentoo should do this too to avoid dhcp server start failure, which can make a lot of problems.

Reproducible: Always



Expected Results:  
which patched init.d script;
/etc/init.d/dhcpd restart
# /etc/init.d/dhcpd restart
 * dhcpd has detected a syntax error in your configuration files:
Internet Systems Consortium DHCP Server V3.1.1-Gentoo
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
WARNING: Host declarations are global.  They are not limited to the scope you declared them in.
//etc/dhcp/dhcpd.conf line 119: Bogus number: -.
  filename = binary-to-ascii (16, 8, -,
                                     ^
Configuration file errors encountered -- exiting
...
Comment 1 Arturas 2009-02-17 15:05:30 UTC
Created attachment 182333 [details, diff]
patch for dhcpd.init file in portage
Comment 2 Wormo (RETIRED) gentoo-dev 2009-02-18 20:00:34 UTC
Thanks for the patch, looks like a good idea. Assigning to maintainers.
Comment 3 Tony Vroon (RETIRED) gentoo-dev 2009-07-09 14:43:14 UTC
+*dhcp-4.1.0 (09 Jul 2009)
+*dhcp-3.1.2 (09 Jul 2009)
+
+  09 Jul 2009; <chainsaw@gentoo.org> +dhcp-3.1.2.ebuild, +dhcp-4.1.0.ebuild,
+  +files/dhcp-4.1-dhclient-metric.patch, +files/dhcp-4.1-no_isc_blurb.patch,
+  +files/dhcpd.init2:
+  Version bump to 3.1.2 & 4.1.0 upstream releases, as requested in bug
+  #264809. Create /var/lib/dhclient as per bug #222261. Recursive chown to
+  dhcp:dhcp closes bug #236671. Test config in init-script, apache-style by
+  Arturas from Lithuania in bug #259364. Paranoia/chroot support now
+  upstream in 4.1, dropped patch.

A very welcome improvement that is now in the portage tree. Thank you for your contribution Arturas :)