From d20754f6ed0b76ebf695c4eadf877edce0536464 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Mon, 12 Dec 2016 15:46:25 -0600 Subject: [PATCH] Use %i instead of %I in dhcp-interface@.service Per the bug report, %I results in -'s in the interface name being replaced with /'s, which means when we try to look up the interface by path in dhcp-all-interfaces.sh we end up at an invalid path. Using %i instead should fix the problem. See https://www.freedesktop.org/software/systemd/man/systemd.unit.html Essentially what is happening is that we start with a name like br-ex that wasn't escaped in the first place. However, because of the - it looks like it could have been escaped to systemd. When we use %I, which tries to unescape escaped values, it unescapes a value that was already not escaped. Change-Id: I434ed2e084d4477dc7a2b7827164586f8ea0c1e3 Closes-Bug: 1649409 --- .../dhcp-all-interfaces/install.d/dhcp-interface@.service | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service b/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service index c22594d5..b066aed6 100644 --- a/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service +++ b/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service @@ -1,5 +1,5 @@ [Unit] -Description=DHCP interface %I +Description=DHCP interface %i # We want to run after network.target so it doesn't try to bring # up the interfaces a second time, but network-online should not # be reached until after we've brought up the interfaces. @@ -7,13 +7,13 @@ After=network.target Before=network-online.target Wants=network-online.target -ConditionPathExists=!/etc/sysconfig/network-scripts/ifcfg-%I +ConditionPathExists=!/etc/sysconfig/network-scripts/ifcfg-%i [Service] Type=oneshot User=root -ExecStartPre=/usr/local/sbin/dhcp-all-interfaces.sh %I -ExecStart=/sbin/ifup %I +ExecStartPre=/usr/local/sbin/dhcp-all-interfaces.sh %i +ExecStart=/sbin/ifup %i RemainAfterExit=true TimeoutStartSec=DIB_DHCP_TIMEOUT