[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Libguestfs] [PATCH] appliance: touch /etc/fstab when enabling the network (RHBZ#1224795)



On Thu, Jul 14, 2016 at 03:13:16PM +0200, Pino Toscano wrote:
> Sadly, the dhclient-script shipped as part of isc-dhcp-client in Ubuntu
> unconditionally reads from /etc/fstab without checking for its
> existence.  Since no package holds /etc/fstab, this file will not exist
> in the appliance, cause dhclient to fail (actually keep looping calling
> the failing dhclient-script) when the network is requested.
> 
> As a workaround, touch /etc/fstab just before enabling the network: if
> that file exists nothing changes, while an empty file will be available
> in the other case, making at least dhclient-script in Ubuntu working.
> ---
>  appliance/init | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/appliance/init b/appliance/init
> index 3fdf4d0..3816dfd 100755
> --- a/appliance/init
> +++ b/appliance/init
> @@ -118,6 +118,7 @@ ip link set dev lo up
>  
>  if test "$guestfs_network" = 1; then
>      iface=$(ls -I all -I default -I lo /proc/sys/net/ipv4/conf)
> +    touch /etc/fstab   # Workaround for Ubuntu.
>      if dhclient --version >/dev/null 2>&1; then
>          dhclient $iface
>      else

ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://libguestfs.org


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]