-
Notifications
You must be signed in to change notification settings - Fork 405
shutdown: "Killing all remaining processes" warning printed unconditionally #2725
Description
Describe the bug
modules.d/99shutdown/shutdown.sh unconditionally prints warn "Killing all remaining processes" on every shutdown, even when no processes need to be killed. This produces unnecessary warning noise on the console during clean shutdowns.
The warning was introduced in commit 551c2dd (Jan 2013) and was historically invisible because older dracut versions (e.g. 048) had a less reliable console redirect. Since version 051, the improved console redirect logic (echo </dev/console subshell check) makes the warning reliably visible.
Distribution used
Ubuntu 22.04 (Jammy)
Dracut version
051-1
Init system
systemd
To Reproduce
- Boot any dracut 051+ system
- Run
shutdown -r nowwhile watching the console
The warning appears every time regardless of system state.
Frequency: 3/3 (100% reproducible)
Expected behavior
Clean shutdown should not display any warnings when there are no remaining processes to kill.
Additional context
Current code (modules.d/99shutdown/shutdown.sh ~line 45):
warn "Killing all remaining processes"
killall_proc_mountpoint /oldroot || sleep 0.2Proposed fix:
if ! killall_proc_mountpoint /oldroot; then
warn "Killed remaining processes using /oldroot"
sleep 0.2
fikillall_proc_mountpoint returns 1 when it kills processes and 0 when none are found, so the warning and sleep should only be triggered when there are actually processes to kill.