]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
arch: kill dirmngr only 327/head
authorLucas De Marchi <lucas.demarchi@intel.com>
Tue, 19 Feb 2019 21:54:56 +0000 (13:54 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 19 Feb 2019 21:54:56 +0000 (13:54 -0800)
Using fuser to identify processes using a path doesn't work as I wanted:
it relies on the filesystem mounted there. The outcome is that when
using "-t directory" it will try to kill all processes using that
filesystem rather than processes using files under that path.

Even by bind-mounting root so it's always a mountpoint, it doesn't work.
So instead of killing everything, pinpoint what process pacman/pacstrap
left running and kill only that one.

Right now this means telling dirmngr to exit.

mkosi

diff --git a/mkosi b/mkosi
index 6fdd96531fb67435e059220bc331ee43f16dced7..c44f61ad3cd8b4cde5805fec6d4e72c6a7152e60 100755 (executable)
--- a/mkosi
+++ b/mkosi
@@ -1828,6 +1828,7 @@ SigLevel    = Required DatabaseOptional TrustAll
 
     # Kill the gpg-agent used by pacman and pacman-key
     run(['gpg-connect-agent', '--homedir', os.path.join(root, 'etc/pacman.d/gnupg'), 'KILLAGENT', '/bye'])
+    run(['gpg-connect-agent', '--homedir', os.path.join(root, 'etc/pacman.d/gnupg'), '--dirmngr', 'KILLDIRMNGR', '/bye'])
 
     if "networkmanager" in args.packages:
         enable_networkmanager(workspace)
@@ -1842,9 +1843,6 @@ SigLevel    = Required DatabaseOptional TrustAll
     with open(os.path.join(workspace, 'root', 'etc/locale.conf'), 'w') as f:
         f.write('LANG=en_US.UTF-8\n')
 
-    # At this point, no process should be left running, kill then
-    run(["fuser", "-c", root, "--kill"])
-
 
 @completestep('Installing openSUSE')
 def install_opensuse(args: CommandLineArguments, workspace: str, run_build_script: bool) -> None: