crash-handler: Call vhangup on /dev/console before spawning crash shell
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 7 Aug 2024 18:44:38 +0000 (20:44 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 7 Aug 2024 19:24:57 +0000 (21:24 +0200)
commitbc3477fdc561f6eda5e73a357e2049d46f2b3077
treef47ad8c16636a5117098c23f74e59206d64ce93d
parent2561e2a35601383bfba30da58d378303cb9e39aa
crash-handler: Call vhangup on /dev/console before spawning crash shell

When pid 1 crashes, the getty unit for the console will happily keep
running which means we end up with two shells competing for the same
tty. Let's call vhangup on /dev/console to kill every other process
attached to the console before we spawn the crash shell. The getty
units have Restart=always but lucky for us, pid 1 just crashed in fire
and flames so it isn't actually able to restart the getty unit.
src/basic/terminal-util.c
src/basic/terminal-util.h
src/core/crash-handler.c