This can of course also be --quiet instead of --verbose, but one messages will stay.
I kind of got what I actually wanted to do (test against a ppa).
But the commands I used can be used to iterate on this issue with different solutions.
I tried:
#1 Hard clean with pkill (killall would equally work)
01_4_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'pkill gpg-agent' >> /tmp/addppa"]
01_5_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'pkill dirmngr' >> /tmp/addppa"]
#2 soft kill with the actual agent closing itself gracefully
01_5_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'gpg-connect-agent --quiet KILLAGENT bye' >> /tmp/addppa"]
The first one works, while the latter fails in a chroot (works locally):
gpg-connect-agent: failed to create temporary file '/root/.gnupg/.#lk0x00005595a8a39c80.ubuntu.6958': No such file or directory
gpg-connect-agent: can't connect to the agent: No such file or directory
gpg-connect-agent: error sending standard options: No agent running
The issue of #2 is the same when calling it e.g. in a lxd guest.
This can of course also be --quiet instead of --verbose, but one messages will stay.
I kind of got what I actually wanted to do (test against a ppa).
But the commands I used can be used to iterate on this issue with different solutions.
late_commands: FRONTEND= noninteractive add-apt-repository --yes ppa:paelzer/bug-1645274-multipath-merge' >> /tmp/addppa"]
01_1_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo '#!/bin/sh' > /tmp/addppa"]
01_2_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'set -uxe' >> /tmp/addppa"]
01_3_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'DEBIAN_
<Testing different cleanups here>
01_6_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'lsof +fg /dev' >> /tmp/addppa"]
01_7_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/chmod +x /tmp/addppa"]
01_8_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/cat /tmp/addppa"]
01_9_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/tmp/addppa"]
I tried:
#1 Hard clean with pkill (killall would equally work)
01_4_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'pkill gpg-agent' >> /tmp/addppa"]
01_5_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'pkill dirmngr' >> /tmp/addppa"]
#2 soft kill with the actual agent closing itself gracefully
01_5_install_ppa: ['curtin', 'in-target', '--', 'sh', '-c', "/bin/echo 'gpg-connect-agent --quiet KILLAGENT bye' >> /tmp/addppa"]
The first one works, while the latter fails in a chroot (works locally): .gnupg/ .#lk0x00005595a 8a39c80. ubuntu. 6958': No such file or directory
gpg-connect-agent: failed to create temporary file '/root/
gpg-connect-agent: can't connect to the agent: No such file or directory
gpg-connect-agent: error sending standard options: No agent running
The issue of #2 is the same when calling it e.g. in a lxd guest.
So for now back to old style killing things :-/