apt feature broken on >=Yakkety due to new gpg agent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GnuPG |
Incomplete
|
Unknown
|
|||
curtin |
Fix Released
|
Undecided
|
Unassigned | ||
curtin (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Unassigned | ||
Yakkety |
Fix Released
|
High
|
Unassigned | ||
Zesty |
Fix Released
|
Medium
|
Unassigned |
Bug Description
----- Begin SRU Template -----
[Impact]
The mechanism for adding PPAs during was prone to failure when installing
16.10 (yakkety) or newer systems.
A curtin install of yakkety with the following configuration would
fail:
apt:
sources:
ignored1:
source: "ppa:paelzer/
[Test Case]
Install a yakkety or zesty system with the above configuration.
This can be accomplished by running the vmtest YakketyTestAptC
with the installed version of curtin.
It has configuration of
apt:
sources:
ignored:
source: "ppa:curtin-
source: "deb $MIRROR $RELEASE-proposed main"
[Regression Potential]
[Other Info]
This failure came as a result of change in behavior of gpg. Curtin
(indirectly through add-apt-repository) uses GPG to add PPAs into a
chroot. GPG2 began daemonizing itself, which meant that unmounts of the
filesystem would fail due to open filehandles of the daemonized gpg
process.
There is further discussion both on the bug and in the upstream
merge proposal [1] on other ways to do this. The solution taken was
a killall of processes named 'dirmgr' or 'gpg-agent' that were spawned
after the chroot.
[1] https:/
----- End SRU Template -----
Hi,
while testing I found that when running apt feature related to add-apt-repository like:
apt:
sources:
ignored1:
source: "ppa:paelzer/
Or in fact any sort of add-apt-repository (also unrelated to the apt feature itself) like:
late_commands:
01_install_ppa: ['curtin', 'in-target --', 'add-apt-repository --yes ppa:paelzer/bug-1645274-multipath-merge']
Then the installation fails.
Both use the chroot to execute in target, but recent add-apt-repository seems so cause daemons to spawn which then let the umount fail.
Failure is usually around something like:
"umount: /tmp/tmptmucmfm
Here an excerpt from a lsof +fg afterwards.
dirmngr 6771 root 1r CHR LG,0x80000 1,9 0t0 11 /tmp/tmptmucmfm
dirmngr 6771 root 2w CHR W,LG 1,3 0t0 6 /tmp/tmptmucmfm
gpg-agent 6776 root 0r CHR LG 1,3 0t0 6 /tmp/tmptmucmfm
gpg-agent 6776 root 1w CHR W,LG 1,3 0t0 6 /tmp/tmptmucmfm
gpg-agent 6776 root 2w CHR W,LG 1,3 0t0 6 /tmp/tmptmucmfm
One of them could be shut down by:
gpg-connect-agent --verbose KILLAGENT
But not dirmngr, that has to be killed.
Actually killing them seems ok (does not seem to create and later fallout).
Related branches
- Server Team CI bot: Approve (continuous-integration)
- curtin developers: Pending requested
-
Diff: 39 lines (+15/-6)1 file modifiedcurtin/commands/apt_config.py (+15/-6)
- Ryan Harper (community): Approve
- Scott Moser: Pending requested
-
Diff: 1365 lines (+661/-168)24 files modifiedcurtin/block/__init__.py (+1/-1)
curtin/commands/apt_config.py (+16/-6)
curtin/commands/block_meta.py (+1/-2)
curtin/commands/curthooks.py (+28/-1)
curtin/deps/__init__.py (+11/-2)
curtin/util.py (+15/-6)
debian/changelog (+20/-0)
debian/new-upstream-snapshot (+47/-3)
examples/tests/centos_basic.yaml (+13/-0)
examples/tests/mirrorboot-msdos-partition.yaml (+82/-0)
helpers/list-flash-kernel-packages (+13/-0)
tests/unittests/test_apt_source.py (+1/-0)
tests/unittests/test_block.py (+2/-0)
tests/unittests/test_curthooks.py (+134/-0)
tests/vmtests/__init__.py (+83/-102)
tests/vmtests/helpers.py (+20/-8)
tests/vmtests/image_sync.py (+31/-17)
tests/vmtests/releases.py (+38/-10)
tests/vmtests/test_apt_config_cmd.py (+4/-0)
tests/vmtests/test_centos_basic.py (+42/-0)
tests/vmtests/test_mdadm_bcache.py (+39/-0)
tests/vmtests/test_raid5_bcache.py (+2/-1)
tools/vmtest-sync-images (+15/-6)
tools/xkvm (+3/-3)
- Blake Rouse (community): Approve
-
Diff: 96 lines (+31/-2)4 files modifiedbin/kpack-from-image (+2/-0)
bin/maas-cloudimg2ephemeral (+2/-0)
bin/maas-qcow2targz (+3/-2)
bin/unshare-pidns (+24/-0)
Changed in gnupg: | |
status: | Unknown → New |
Changed in gnupg: | |
status: | New → Incomplete |
Changed in curtin (Ubuntu Xenial): | |
status: | New → Fix Released |
status: | Fix Released → Confirmed |
importance: | Undecided → Medium |
status: | Confirmed → Triaged |
Changed in curtin (Ubuntu Zesty): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
Changed in curtin: | |
status: | Confirmed → Fix Committed |
Changed in curtin (Ubuntu Xenial): | |
status: | Triaged → Fix Committed |
tags: |
added: verification-needed-xenial verification-needed-yakkety removed: verification-needed |
tags: |
added: verification-done-yakkety removed: verification-needed-yakkety |
FYI - at least for gpg-agent there seems to be a softer way to remove it which is
$ gpg-connect-agent --verbose KILLAGENT bye