blob: c8cd45bcb4b41b84287f1f179378da269a0bde0e [file] [log] [blame]
Subject: cloud-init on azure required dhclient not to be
included in /tmp.
diff --git a/cloudinit/net/dhcp.py b/cloudinit/net/dhcp.py
index c033cc8..be60f6f 100644
--- a/cloudinit/net/dhcp.py
+++ b/cloudinit/net/dhcp.py
@@ -205,13 +205,9 @@ def dhcp_discovery(dhclient_cmd_path, interface, cleandir):
"""
LOG.debug('Performing a dhcp discovery on %s', interface)
- # XXX We copy dhclient out of /sbin/dhclient to avoid dealing with strict
- # app armor profiles which disallow running dhclient -sf <our-script-file>.
# We want to avoid running /sbin/dhclient-script because of side-effects in
# /etc/resolv.conf any any other vendor specific scripts in
# /etc/dhcp/dhclient*hooks.d.
- sandbox_dhclient_cmd = os.path.join(cleandir, 'dhclient')
- util.copy(dhclient_cmd_path, sandbox_dhclient_cmd)
pid_file = os.path.join(cleandir, 'dhclient.pid')
lease_file = os.path.join(cleandir, 'dhcp.leases')
@@ -220,7 +216,7 @@ def dhcp_discovery(dhclient_cmd_path, interface, cleandir):
# link up before attempting discovery. Since we are using -sf /bin/true,
# we need to do that "link up" ourselves first.
util.subp(['ip', 'link', 'set', 'dev', interface, 'up'], capture=True)
- cmd = [sandbox_dhclient_cmd, '-1', '-v', '-lf', lease_file,
+ cmd = ['dhclient', '-1', '-v', '-lf', lease_file,
'-pf', pid_file, interface, '-sf', '/bin/true']
util.subp(cmd, capture=True)
diff --git a/cloudinit/sources/helpers/azure.py b/cloudinit/sources/helpers/azure.py
index fc76058..869d462 100755
--- a/cloudinit/sources/helpers/azure.py
+++ b/cloudinit/sources/helpers/azure.py
@@ -90,7 +90,7 @@ def get_boot_telemetry():
raise RuntimeError("Failed to determine kernel start timestamp")
try:
- out, _ = util.subp(['/bin/systemctl',
+ out, _ = util.subp(['systemctl',
'show', '-p',
'UserspaceTimestampMonotonic'],
capture=True)
@@ -112,7 +112,7 @@ def get_boot_telemetry():
% e)
try:
- out, _ = util.subp(['/bin/systemctl', 'show',
+ out, _ = util.subp(['systemctl', 'show',
'cloud-init-local', '-p',
'InactiveExitTimestampMonotonic'],
capture=True)