Skip to content

shutdown: "Killing all remaining processes" warning printed unconditionally #2725

@artskirk

Description

@artskirk

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

  1. Boot any dracut 051+ system
  2. Run shutdown -r now while 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.2

Proposed fix:

if ! killall_proc_mountpoint /oldroot; then
    warn "Killed remaining processes using /oldroot"
    sleep 0.2
fi

killall_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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugOur bugs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions