Tweak dhclient arguments for readability
A number of tests and examples use dhclient in both IPv4 and IPv6 modes. We use "dhclient -6" for IPv6, but usually just "dhclient" for IPv4. Add an explicit "-4" argument to make it more clear and explicit. In addition, when dhclient is run from within pasta it usually won't be "real" root, and so will not have access to write the default global pid file. This results in a mostly harmless but irritating error: Can't create /var/run/dhclient.pid: Permission denied We can avoid that by using the --no-pid flag to dhclient. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:

committed by
Stefano Brivio

parent
2320ac3349
commit
ca0c33ae5b
@@ -23,8 +23,8 @@ check [ -n "__IFNAME1__" ]
|
||||
check [ -n "__IFNAME2__" ]
|
||||
|
||||
test DHCP: addresses
|
||||
guest1 /sbin/dhclient __IFNAME1__
|
||||
guest2 /sbin/dhclient __IFNAME1__
|
||||
guest1 /sbin/dhclient -4 __IFNAME1__
|
||||
guest2 /sbin/dhclient -4 __IFNAME1__
|
||||
g1out ADDR1 ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__IFNAME1__").addr_info[0].local'
|
||||
g2out ADDR2 ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__IFNAME2__").addr_info[0].local'
|
||||
hout HOST_ADDR ip -j -4 addr show|jq -rM '.[] | select(.ifname == "__HOST_IFNAME__").addr_info[0].local'
|
||||
|
Reference in New Issue
Block a user