This fails 100% of the time in zesty and artful emitting "Can't create dhclient[3296]: Can't create /var/tmp/cloud-init/.../dhclient.pid"
If I add a sleep(0.000001) in cloudinit/net/dhcp.py on line 123 just after the sandbox_dhclient_cmd, no pidfile write errors are produced by dhclient in /var/log/syslog.
In further testing it is a timing thing with our tempdirectory being removed before dhclient attempts to write the actual pidfile.
sudo python3 -c 'from cloudinit.net.dhcp import maybe_perform_ dhcp_discovery; maybe_perform_ dhcp_discovery( )'
This fails 100% of the time in zesty and artful emitting "Can't create dhclient[3296]: Can't create /var/tmp/ cloud-init/ .../dhclient. pid"
If I add a sleep(0.000001) in cloudinit/ net/dhcp. py on line 123 just after the sandbox_ dhclient_ cmd, no pidfile write errors are produced by dhclient in /var/log/syslog.