cloud-init dhcp_discovery() crashes on preprovisioned RHEL 7.6 VM in Azure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Azure, creating a RHEL 7.6 VM from a pool of preprovisioned VM
In /usr/lib/
There’s a behavior difference between the Ubuntu and RHEL versions of dhclient:
• On Ubuntu, dhclient writes the DHCP lease response, forks/daemonizes, then writes the pid file with the daemonized process ID.
• On RHEL, dhclient writes a pid file with the pre-daemon pid, writes the DHCP lease response, forks/daemonizes, then overwrites the pid file with the new (daemonized) pid.
On RHEL, there’s a race between dhcp_discovery() and dhclient:
1. dhclient writes the pid file and lease file
2. dhclient forks; the parent process exits
3. dhcp_discovery() sees that the pid file and lease file exist
4. dhcp_discovery() tries to kill the process named in the pid file, but it already exited in step 2
5. dhclient child starts, daemonizes, and writes its pid in the pid file
When cloud-init runs on a preprovisioned RHEL 7.6 VM in Azure, dhcp.py dhcp_discovery() throws an error when it tries to send SIGKILL to a process that does not exist.
We have a patch that makes dhcp_discovery() wait until the pid in the pid file represents a daemon process (parent pid is 1) before killing the process. With this change, the issue is resolved.
This bug is fixed with commit fdadcb5f to cloud-init on branch master. /git.launchpad. net/cloud- init/commit/ ?id=fdadcb5f
To view that commit see the following URL:
https:/