[Libguestfs] [PATCH 1/2] appliance init: find NIC name for dhcpcd

Pino Toscano ptoscano at redhat.com
Tue Jul 28 15:49:43 UTC 2015


On Tuesday 28 July 2015 15:21:37 Cédric Bosdonnat wrote:
> dhcpcd requires an interface name as parameter to work. We are now
> getting it from /proc/sys/net/ipv4/conf/ folder children.
> ---
>  appliance/init | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/appliance/init b/appliance/init
> index cca62e7..ef18959 100755
> --- a/appliance/init
> +++ b/appliance/init
> @@ -111,7 +111,8 @@ if test "$guestfs_network" = 1; then
>      if dhclient --version >/dev/null 2>&1; then
>          dhclient
>      else
> -        dhcpcd
> +        iface=$(ls -I all -I default -I lo /proc/sys/net/ipv4/conf)
> +        dhcpcd $iface

I'm noticing the same issue (not requesting for any interface) also on
a current Debian/testing system, which uses isc-dchp (dhclient).

I'd say that might be better to just extend this also to dhclient, so
passing the network interface to whichever dhcp client is used on the
appliance. At least, this seems to not break things on Debian/testing
and Fedora/21 (both using dhclient).

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20150728/29b51e89/attachment.sig>


More information about the Libguestfs mailing list