Bug 496233 - dhclient-script doesn't source ifcfg-* files
dhclient-script doesn't source ifcfg-* files
Product: Fedora
Classification: Fedora
Component: dhcp (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: David Cantrell
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2009-04-17 09:27 EDT by Miroslav Lichvar
Modified: 2010-01-27 10:20 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-01-27 10:20:23 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Miroslav Lichvar 2009-04-17 09:27:01 EDT
Description of problem:

It seems there was an incompatible change in need_config() and source_config() functions that cause ignoring of NTPPEER=no in ifcfg-* files.

/sbin/dhclient-script contains:

need_config ${CONFIG}
source_config >/dev/null 2>&1

But this no longer works correctly, need_config now keeps in CONFIG only the basename of the ifcfg path and source_config tries to source it in current directory which is /.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. configure DHCP server to provide some NTP servers
2. add NTPPEER=no to ifcfg-eth0
3. disable NetworkManager (that's probably another bug)
Actual results:
/etc/ntp.conf modified

Expected results:
dhclient doesn't touch /etc/ntp.conf

Additional info:
Comment 1 Bill Nottingham 2009-04-17 10:11:06 EDT
I'm assuming:

diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-script
index 628cae4..c25deef 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -68,8 +68,8 @@ source_config ()
-    . ./$CONFIG
-    [ -r "keys-$DEVNAME" ] && . ./keys-$DEVNAME
+    . /etc/sysconfig/network-scripts/$CONFIG
+    [ -r "keys-$DEVNAME" ] && . /etc/sysconfig/network-scripts/keys-$DEVNAME
     case "$TYPE" in

fixes it for you?
Comment 2 iarly selbir 2009-04-17 11:57:14 EDT
Assigning it.

BugZapper Team Member.
Comment 3 Miroslav Lichvar 2009-04-20 03:43:41 EDT
Not sure what has changed but after update to the latest rawhide it works, the current directory is /etc/sysconfig/network-scripts.

Sorry for the noise.
Comment 4 Miroslav Lichvar 2009-04-21 07:51:34 EDT
Ok, I'm still seeing this. It doesn't show up right after start, but after first DHCP renewal. I guess the first dhclient-script run happens before dhclient chdirs to /.

Adding "cd /etc/sysconfig/network-scripts" to /sbin/dhclient-script should fix it.
Comment 5 David Cantrell 2009-04-21 16:11:35 EDT
Is this the change we need?

Index: dhclient-script
RCS file: /cvs/pkgs/rpms/dhcp/devel/dhclient-script,v
retrieving revision 1.11
diff -u -p -r1.11 dhclient-script
--- dhclient-script	21 Apr 2009 01:14:15 -0000	1.11
+++ dhclient-script	21 Apr 2009 20:11:13 -0000
@@ -420,7 +420,8 @@ if [ -f /etc/sysconfig/networking/networ
     . /etc/sysconfig/networking/network
+cd /etc/sysconfig/network-scripts
 need_config ${CONFIG}
 source_config >/dev/null 2>&1
Comment 6 Miroslav Lichvar 2009-04-21 16:33:36 EDT
Yes, that should do it.
Comment 7 David Cantrell 2009-04-21 16:46:32 EDT
Will be fixed in dhcp-4.1.0-19.fc11 and later.
Comment 8 Bug Zapper 2009-06-09 09:59:59 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:

Note You need to log in before you can comment on or make changes to this bug.