Fix dhclient enter hook path on RHEL-based amps

dhclient-script(8) defines the enter hook path is
/etc/dhcp/dhclient-enter-hooks:

"On  after defining the make_resolv_conf function, the client script
checks for the presence of an executable /etc/dhcp/dhclient-enter-hooks
script, and if present, it invokes the script inline, using the Bourne
shell command."

This was confirmed to be valid on RHEL and CentOS 7-8, and Fedora 28-30.

Change-Id: I473f1e5c6862ebf0d691a8191d17649ccf51e7f4
Task: 35725
Story: 2006190
This commit is contained in:
Carlos Goncalves 2019-07-09 12:34:16 +02:00
parent e3aacb67ad
commit 6c0756864f
2 changed files with 7 additions and 2 deletions

View File

@ -11,8 +11,8 @@ make_resolv_conf() { : ; }" > /etc/dhcp/dhclient-enter-hooks.d/noresolvconf
else
# RHEL/CentOS/Fedora
echo "#!/bin/sh
make_resolv_conf() { : ; }" > /etc/dhclient-enter-hooks
chmod +x /etc/dhclient-enter-hooks
make_resolv_conf() { : ; }" > /etc/dhcp/dhclient-enter-hooks
chmod +x /etc/dhcp/dhclient-enter-hooks
fi
if [ -e /etc/nsswitch.conf ]; then

View File

@ -0,0 +1,5 @@
---
fixes:
- |
Fixed an issue where /etc/resolv.conf on RHEl-based amphorae was being
populated with DNS servers.