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
Cédric Bosdonnat
2015-Jul-28 13:21 UTC
[Libguestfs] [PATCH 1/2] appliance init: find NIC name for dhcpcd
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
Cédric Bosdonnat
2015-Jul-28 13:21 UTC
[Libguestfs] [PATCH 2/2] Make sure gpg-agent is terminated before umount
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
Pino Toscano
2015-Jul-28 15:49 UTC
Re: [Libguestfs] [PATCH 1/2] appliance init: find NIC name for dhcpcd
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 $ifaceI'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
Pino Toscano
2015-Jul-28 17:15 UTC
Re: [Libguestfs] [PATCH 2/2] Make sure gpg-agent is terminated before umount
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
Possibly Parallel Threads
- Re: [PATCH 2/2] Make sure gpg-agent is terminated before umount
- Re: [PATCH 2/2] Make sure gpg-agent is terminated before umount
- [PATCH] customize: Add --uninstall operation.
- [PATCH] customize: Make dnf upgrade to the latest versions of packages.
- [PATCH 0/2] Misc fixes