[PATCH 0/2] Misc fixes
Here are two patches: one fixes the gpg-agent causing unmount to fail after running dnf to install packages. The other ones fixes dhcpcd call in the init program to provide it an interface name. Cédric Bosdonnat (2): appliance init: find NIC name for dhcpcd Make sure gpg-agent is terminated before umount appliance/init | 3 ++- customize/customize_run.ml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -- 2.1.4
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 fi fi -- 2.1.4
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
gpg-agent uses /sysroot/dev/null and thus /sysroot/dev can't be unmounted if gpg-agent is still around. Note that this problem only affects installing packages on fedora-22 guests. --- customize/customize_run.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/customize/customize_run.ml b/customize/customize_run.ml index bce0aca..81b0951 100644 --- a/customize/customize_run.ml +++ b/customize/customize_run.ml @@ -96,7 +96,8 @@ exec >>%s 2>&1 apt-get $apt_opts install %s " quoted_args | "dnf" -> - sprintf "dnf -y install %s" quoted_args + sprintf "dnf -y install %s + pkill gpg-agent" quoted_args | "pisi" -> sprintf "pisi it %s" quoted_args | "pacman" -> -- 2.1.4
On Tuesday 28 July 2015 15:21:38 Cédric Bosdonnat wrote:
gpg-agent uses /sysroot/dev/null and thus /sysroot/dev can't be unmounted if gpg-agent is still around. Note that this problem only affects installing packages on fedora-22 guests. --- customize/customize_run.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/customize/customize_run.ml b/customize/customize_run.ml index bce0aca..81b0951 100644 --- a/customize/customize_run.ml +++ b/customize/customize_run.ml @@ -96,7 +96,8 @@ exec >>%s 2>&1 apt-get $apt_opts install %s " quoted_args | "dnf" -> - sprintf "dnf -y install %s" quoted_args + sprintf "dnf -y install %s + pkill gpg-agent" quoted_args | "pisi" -> sprintf "pisi it %s" quoted_args | "pacman" ->
NACK to this patch, as it just sweeps the issue under the carpet. Basically, this is triggered by the following: $ virt-builder fedora-22 --install <whatever> gnupg2 (used to import keys the first time when installing packages from a repository) requires the use of an agent, thus spawning gnupg-agent which holds /sysroot/dev, which cannot be unmounted. It seems that this issue has been fixed in recent versions of gnupg2/rpm/dnf, so updating before installing anything: $ virt-builder fedora-22 --update --install <whatever> which should then work (at least it does for me). Rich, if this fixes the problem for you as well, would it be possible to update the fedora-22 templates with newer versions of packages? Thanks, -- Pino Toscano
On Tue, Jul 28, 2015 at 07:15:33PM +0200, Pino Toscano wrote:
On Tuesday 28 July 2015 15:21:38 Cédric Bosdonnat wrote:
gpg-agent uses /sysroot/dev/null and thus /sysroot/dev can't be unmounted if gpg-agent is still around. Note that this problem only affects installing packages on fedora-22 guests. --- customize/customize_run.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/customize/customize_run.ml b/customize/customize_run.ml index bce0aca..81b0951 100644 --- a/customize/customize_run.ml +++ b/customize/customize_run.ml @@ -96,7 +96,8 @@ exec >>%s 2>&1 apt-get $apt_opts install %s " quoted_args | "dnf" -> - sprintf "dnf -y install %s" quoted_args + sprintf "dnf -y install %s + pkill gpg-agent" quoted_args | "pisi" -> sprintf "pisi it %s" quoted_args | "pacman" ->
NACK to this patch, as it just sweeps the issue under the carpet.
Basically, this is triggered by the following: $ virt-builder fedora-22 --install <whatever> gnupg2 (used to import keys the first time when installing packages from a repository) requires the use of an agent, thus spawning gnupg-agent which holds /sysroot/dev, which cannot be unmounted.
It seems that this issue has been fixed in recent versions of gnupg2/rpm/dnf, so updating before installing anything: $ virt-builder fedora-22 --update --install <whatever> which should then work (at least it does for me).
Rich, if this fixes the problem for you as well, would it be possible to update the fedora-22 templates with newer versions of packages?
Yes - is it only gnupg2 which needs to be updated, or all 3 packages (gnupg2 + rpm + dnf)? Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com Fedora Windows cross-compiler. Compile Windows programs, test, and build Windows installers. Over 100 libraries supported. http://fedoraproject.org/wiki/MinGW
FWIW I was NOT able to reproduce this on Fedora 21 host running: $ virt-builder fedora-22 --install mc [...] Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v
participants (3)
-
Cédric Bosdonnat -
Pino Toscano -
Richard W.M. Jones