Resolves: rhbz805307
It is useless to configurate the /etc/dhclient.conf to valid in the second kernel, when get network config by dhcp. Using the following dhclient configuration, the kernel will not override the configuration getting from the dhcp server in the file /etc/resolv.conf.
supersede domain-name "machine.test.group"; supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
According to the condition, we should determine to modify the /etc/dhclient.conf or not. If set the PEERDNS="no" in the configuration of /etc/sysconfig/network-scripts/ifcfg-$net_dev, the dhclient configuration will override the search domain and dns servers received from dhcp server.
Signed-off-by: Minfei Huang mhuang@redhat.com --- dracut-module-setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 02a0557..008e560 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -66,6 +66,16 @@ kdump_setup_dns() { [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" }
+kdump_setup_dhclient() { + _dhclient_file="/etc/dhclient.conf" + [ ! -e $_dhclient_file ] && return + + . /etc/sysconfig/network-scripts/ifcfg-$1 + if [ "x""$PEERDNS" = "xno" ] || [ "x""$PEERDNS" = "xNO" ]; then + cat $_dhclient_file | grep ^supersede >> ${initdir}/$_dhclient_file + fi +} + #$1: netdev name #$2: srcaddr #if it use static ip echo it, or echo null @@ -252,6 +262,8 @@ kdump_setup_netdev() { fi
kdump_setup_dns "$_netdev" + + kdump_setup_dhclient "$_netdev" }
#Function:kdump_install_net
On Thu, Sep 11, 2014 at 01:29:47PM +0800, Minfei Huang wrote:
Resolves: rhbz805307
This is RHEL bug number. Please don't specify it when you are posting patches for inclusion in fedora.
It is useless to configurate the /etc/dhclient.conf to valid in the second kernel, when get network config by dhcp. Using the following dhclient configuration, the kernel will not override the configuration getting from the dhcp server in the file /etc/resolv.conf.
supersede domain-name "machine.test.group"; supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
According to the condition, we should determine to modify the /etc/dhclient.conf or not. If set the PEERDNS="no" in the configuration of /etc/sysconfig/network-scripts/ifcfg-$net_dev, the dhclient configuration will override the search domain and dns servers received from dhcp server.
I think this changelog description needs to be improved. I can't understand what's the problem. So changelog should describe few things very cleary.
- What's the problem. - Why that problem is happening in current code. - How your patch fixes that problem.
I think you have focussed a lot on 3 part but first two things are missing from changelog.
Thanks Vivek
Signed-off-by: Minfei Huang mhuang@redhat.com
dracut-module-setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 02a0557..008e560 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -66,6 +66,16 @@ kdump_setup_dns() { [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" }
+kdump_setup_dhclient() {
- _dhclient_file="/etc/dhclient.conf"
- [ ! -e $_dhclient_file ] && return
- . /etc/sysconfig/network-scripts/ifcfg-$1
- if [ "x""$PEERDNS" = "xno" ] || [ "x""$PEERDNS" = "xNO" ]; then
cat $_dhclient_file | grep ^supersede >> ${initdir}/$_dhclient_file
- fi
+}
#$1: netdev name #$2: srcaddr #if it use static ip echo it, or echo null @@ -252,6 +262,8 @@ kdump_setup_netdev() { fi
kdump_setup_dns "$_netdev"
- kdump_setup_dhclient "$_netdev"
}
#Function:kdump_install_net
1.8.3.1
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On 09/12/2014 12:03 AM, Vivek Goyal wrote:
On Thu, Sep 11, 2014 at 01:29:47PM +0800, Minfei Huang wrote:
Resolves: rhbz805307
This is RHEL bug number. Please don't specify it when you are posting patches for inclusion in fedora.
It is useless to configurate the /etc/dhclient.conf to valid in the second kernel, when get network config by dhcp. Using the following dhclient configuration, the kernel will not override the configuration getting from the dhcp server in the file /etc/resolv.conf.
supersede domain-name "machine.test.group"; supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
According to the condition, we should determine to modify the /etc/dhclient.conf or not. If set the PEERDNS="no" in the configuration of /etc/sysconfig/network-scripts/ifcfg-$net_dev, the dhclient configuration will override the search domain and dns servers received from dhcp server.
I think this changelog description needs to be improved. I can't understand what's the problem. So changelog should describe few things very cleary.
- What's the problem.
- Why that problem is happening in current code.
- How your patch fixes that problem.
I think you have focussed a lot on 3 part but first two things are missing from changelog.
Thanks Vivek
The network will get the DNS from the /etc/resolv.conf. The config resolv.conf generates by the dhcp server, also we can modify it manually. But the configuration which we add manually to the resolv.conf will be lost when the network restart.
So in order to solve this problem, we can add the option of PEERDNS=no to the ifcfg-{*}, the resolv.conf file will not be changed again by the dhcp server.
The dracut will use own default configuration (in dracut directory) to configure the network, whatever the custom modify the configuration in /etc/dhclient.conf. I send a patch to the dracut community. The patch can only do one thing that it will append the valid content from /etc/dhclient.conf to ${initdir}/etc/dhclient.conf.
We(Dave and me) think that the configuratin need to be valid in the second kernel, if the custom set the own configuration to the dhclient.conf. So we should ignore the option of PEERDNS, even if set the option PEERDNS=no in ifcfg-*. And the kdump will have no change for this BUG.
Signed-off-by: Minfei Huang mhuang@redhat.com
dracut-module-setup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 02a0557..008e560 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -66,6 +66,16 @@ kdump_setup_dns() { [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" }
+kdump_setup_dhclient() {
- _dhclient_file="/etc/dhclient.conf"
- [ ! -e $_dhclient_file ] && return
- . /etc/sysconfig/network-scripts/ifcfg-$1
- if [ "x""$PEERDNS" = "xno" ] || [ "x""$PEERDNS" = "xNO" ]; then
cat $_dhclient_file | grep ^supersede >> ${initdir}/$_dhclient_file
- fi
+}
- #$1: netdev name #$2: srcaddr #if it use static ip echo it, or echo null
@@ -252,6 +262,8 @@ kdump_setup_netdev() { fi
kdump_setup_dns "$_netdev"
kdump_setup_dhclient "$_netdev" }
#Function:kdump_install_net
-- 1.8.3.1
kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec
On Fri, Sep 12, 2014 at 07:56:10AM -0400, Minfei Huang wrote:
[..]
The network will get the DNS from the /etc/resolv.conf. The config resolv.conf generates by the dhcp server, also we can modify it manually. But the configuration which we add manually to the resolv.conf will be lost when the network restart.
So in order to solve this problem, we can add the option of PEERDNS=no to the ifcfg-{*}, the resolv.conf file will not be changed again by the dhcp server.
The dracut will use own default configuration (in dracut directory) to configure the network, whatever the custom modify the configuration in /etc/dhclient.conf. I send a patch to the dracut community. The patch can only do one thing that it will append the valid content from /etc/dhclient.conf to ${initdir}/etc/dhclient.conf.
So what does dhclient.conf do?
We(Dave and me) think that the configuratin need to be valid in the second kernel, if the custom set the own configuration to the dhclient.conf. So we should ignore the option of PEERDNS, even if set the option PEERDNS=no in ifcfg-*. And the kdump will have no change for this BUG.
Sorry, I still did not get that why should we ignore PEERDNS if specified in ifcfg*.
Thanks Vivek
On 09/12/2014 08:09 PM, Vivek Goyal wrote:
On Fri, Sep 12, 2014 at 07:56:10AM -0400, Minfei Huang wrote:
[..]
The network will get the DNS from the /etc/resolv.conf. The config resolv.conf generates by the dhcp server, also we can modify it manually. But the configuration which we add manually to the resolv.conf will be lost when the network restart.
So in order to solve this problem, we can add the option of PEERDNS=no to the ifcfg-{*}, the resolv.conf file will not be changed again by the dhcp server.
The dracut will use own default configuration (in dracut directory) to configure the network, whatever the custom modify the configuration in /etc/dhclient.conf. I send a patch to the dracut community. The patch can only do one thing that it will append the valid content from /etc/dhclient.conf to ${initdir}/etc/dhclient.conf.
So what does dhclient.conf do?
We can add following to the /etc/dhclient.conf, the /etc/resolv.conf will add the relevant configruation automatically by step.
supersede domain-name "machine.test.group"; supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
Then the /etc/resolv.conf will be:
domain machine.test.group search machine.test.group nay.redhat.com. redhat.com. nameserver 10.125.97.171 nameserver 10.126.98.43 nameserver 10.125.97.176
The search domain and DNS generate by the dhclient.conf which the custom wants.
We(Dave and me) think that the configuratin need to be valid in the second kernel, if the custom set the own configuration to the dhclient.conf. So we should ignore the option of PEERDNS, even if set the option PEERDNS=no in ifcfg-*. And the kdump will have no change for this BUG.
Sorry, I still did not get that why should we ignore PEERDNS if specified in ifcfg*.
if set the PEERDNS=no in ifcfg-*, it implies that custom doesnot want to change the resolv.conf by the system.
In the other words, the configuration file /etc/resolv.conf changes nothing when setting the PEERDNS=no, although we customize the dhclient.conf.
Under the priciple of simple in the second kernel, if customize the dhclient.conf, it is default that we should change the search domain and DNS by the dhclient.conf, also custom will be glad to see it.
We think that customize the dhclient.conf once, it represents the custom want to use the own configuration of search domain and DNS.
So, there is needless to check the PEERDNS in the if ifcfg-*.
Thanks Vivek
On Fri, Sep 12, 2014 at 08:55:53AM -0400, Minfei Huang wrote:
On 09/12/2014 08:09 PM, Vivek Goyal wrote:
On Fri, Sep 12, 2014 at 07:56:10AM -0400, Minfei Huang wrote:
[..]
The network will get the DNS from the /etc/resolv.conf. The config resolv.conf generates by the dhcp server, also we can modify it manually. But the configuration which we add manually to the resolv.conf will be lost when the network restart.
So in order to solve this problem, we can add the option of PEERDNS=no to the ifcfg-{*}, the resolv.conf file will not be changed again by the dhcp server.
The dracut will use own default configuration (in dracut directory) to configure the network, whatever the custom modify the configuration in /etc/dhclient.conf. I send a patch to the dracut community. The patch can only do one thing that it will append the valid content from /etc/dhclient.conf to ${initdir}/etc/dhclient.conf.
So what does dhclient.conf do?
We can add following to the /etc/dhclient.conf, the /etc/resolv.conf will add the relevant configruation automatically by step.
supersede domain-name "machine.test.group"; supersede domain-name-servers 10.125.97.171, 10.126.98.43, 10.125.97.176;
Then the /etc/resolv.conf will be:
domain machine.test.group search machine.test.group nay.redhat.com. redhat.com. nameserver 10.125.97.171 nameserver 10.126.98.43 nameserver 10.125.97.176
The search domain and DNS generate by the dhclient.conf which the custom wants.
We(Dave and me) think that the configuratin need to be valid in the second kernel, if the custom set the own configuration to the dhclient.conf. So we should ignore the option of PEERDNS, even if set the option PEERDNS=no in ifcfg-*. And the kdump will have no change for this BUG.
Sorry, I still did not get that why should we ignore PEERDNS if specified in ifcfg*.
if set the PEERDNS=no in ifcfg-*, it implies that custom doesnot want to change the resolv.conf by the system.
In the other words, the configuration file /etc/resolv.conf changes nothing when setting the PEERDNS=no, although we customize the dhclient.conf.
Under the priciple of simple in the second kernel, if customize the dhclient.conf, it is default that we should change the search domain and DNS by the dhclient.conf, also custom will be glad to see it.
We think that customize the dhclient.conf once, it represents the custom want to use the own configuration of search domain and DNS.
So, there is needless to check the PEERDNS in the if ifcfg-*.
Ok, thanks. Few more questions.
- So what dhclient.conf dracut is including in initramfs. Is it same dhclient.conf as in /etc/?
- Bug seems to be saying entirely different thing. They seem to be suggesting that honor PEERDNS instead of ignoring it.
- As per your description it seems to make no sense to use PEERDNS=no as we has specify something in dhclient.conf. If we want dhclient.conf to take affect then we should not specify PEERDNS=no. That seems to be a configuration issue and not a software bug?
Thanks Vivek
Thanks Vivek
-- Minfei _______________________________________________ kexec mailing list kexec@lists.fedoraproject.org https://lists.fedoraproject.org/mailman/listinfo/kexec