From: Frantisek Sumsal Date: Mon, 5 Sep 2022 19:02:25 +0000 (+0200) Subject: test: kill plymouthd after initrd transition if it's still running X-Git-Tag: v252-rc1~248 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c08efee033f81eba929130a6cacb53069a6c0a7;p=thirdparty%2Fsystemd.git test: kill plymouthd after initrd transition if it's still running Until now using the INTERACTIVE_DEBUG=yes stuff together with sanitizers was almost impossible, since the console kept eating up our inputs or not responding at all. After a painful day of debugging I noticed that if we use a shell script in the initrd -> root transition, we might end up with a plymouthd still running, which kept screwing with the tty. E.g. with initrd -> wrapper -> systemd transition, where the `wrapper` is a simple script: ``` exec -- /usr/lib/systemd/systemd "$@" ``` we'd end up with a stray plymouthd process after the bootup: ``` 1 0 440 2 20 0 0 0 worker I ? 0:00 [kworker/5:2-ata_sff] 1 0 453 2 20 0 0 0 worker I ? 0:00 [kworker/9:2-rcu_gp] 5 0 456 1 20 0 7252 1960 do_epo S ? 0:00 @usr/sbin/plymouthd --mode=boot --pid-file=/run/plymouth/pid --attach-to-session ``` After killing it, the tty works finally as expected. --- diff --git a/test/test-functions b/test/test-functions index c8b0cef1f23..6215ec1cc64 100644 --- a/test/test-functions +++ b/test/test-functions @@ -179,6 +179,7 @@ BASICTOOLS=( head ionice ip + killall ldd ln loadkeys @@ -1794,6 +1795,26 @@ install_debug_tools() { image_install resize echo "resize" >>"$initdir/etc/profile" fi + + # Sometimes we might end up with plymouthd still running (especially + # with the initrd -> asan_wrapper -> systemd transition), which will eat + # our inputs and make debugging via tty impossible. Let's fix this by + # killing plymouthd explicitly for the interactive sessions. + # Note: we can't use pkill/pidof/etc. here due to a bug in libasan, see: + # - https://github.com/llvm/llvm-project/issues/49223 + # - https://bugzilla.redhat.com/show_bug.cgi?id=2098125 + local plymouth_unit="${initdir:?}/etc/systemd/system/kill-plymouth.service" + cat >"$plymouth_unit" <