]> git.ipfire.org Git - thirdparty/mkosi.git/commit
Delay KeyboardInterrupt() handling when running a subprocess 442/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Mon, 27 Jul 2020 18:39:16 +0000 (19:39 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 28 Jul 2020 18:11:41 +0000 (19:11 +0100)
commit74c08c979c9c60cbda0ec70e52ba3ebb28519589
tree945aef3a8556005e563aec912f461a17895dbed0
parentddfd8aa9fa57fa8065b8eb701f414ad07d43f1d1
Delay KeyboardInterrupt() handling when running a subprocess

Because we weren't giving subprocess time to gracefully exit, we'd
often get "Device or resource is busy" errors when CTRL+C'ing mkosi
as we we'd try to unmount directories while a subprocess was still
running in it. By delaying handling of SIGINT while a subprocess is
running, the subprocess can exit gracefully which prevents EBUSY errors
from occurring when running cleanup code. To allow interrupting hanging
subprocesses, we only delay the first SIGINT we receive. If a user
presses CTRL+C again, we exit immediately as before.
mkosi