LinuxCommandLibrary

killall5

Kill all processes except the current shell

SYNOPSIS

killall5 [-signal]

PARAMETERS

-signal
    Specifies the signal to send to the processes. This can be a signal name (e.g., TERM, HUP, KILL) or a signal number (e.g., 15, 1, 9). If no signal is specified, SIGTERM (signal 15) is sent by default. For example, killall5 -HUP sends SIGHUP.

DESCRIPTION

killall5 is a utility traditionally part of the System V (SysV) init system, primarily used during system shutdown or runlevel changes.

Unlike the more common killall command which terminates processes by name, killall5 is designed to send a specified signal to virtually all processes running on the system, with the notable exceptions of the init process, processes on the console, and processes of the current session or login. This makes it a powerful and potentially destructive command if misused, as it performs a sweeping termination of user and daemon processes.

Its main purpose is to prepare the system for a clean state, typically by sending a SIGTERM (15) to allow processes to shut down gracefully, followed by a SIGKILL (9) for any stubborn processes that failed to terminate. It is usually invoked by init scripts or the shutdown command as part of the runlevel transition sequence.

CAVEATS

killall5 is deeply tied to System V init systems and is less relevant in environments predominantly using systemd, although it might exist for compatibility. Its use as a general-purpose command for killing processes is strongly discouraged due to its broad impact; it is intended for system-wide state transitions. Misuse can lead to data loss or system instability. It specifically avoids killing critical system processes like init itself and the current shell/console processes to maintain system control during shutdown.

RUNLEVEL UTILITY

killall5 is a utility specifically designed for System V init systems to facilitate the termination of processes during runlevel transitions, especially during system shutdown. It's typically invoked by init or shutdown scripts to ensure a clean state before changing to a new runlevel or powering off.

DISTINCTION FROM KILLALL

It's crucial to distinguish killall5 from the more common killall command. While killall terminates processes by their name, killall5 targets virtually all processes running on the system, excluding only critical system processes like init and the current shell. This makes killall5 a much broader and more impactful command, primarily used for system-wide cleanup.

HISTORY

killall5 originates from the System V (SysV) init system, which was the standard Unix-like initialization system for decades before the rise of systemd. It was developed as an integral part of the runlevel concept, ensuring that a system could transition cleanly between different operational states by terminating non-essential processes. Its name directly reflects its SysV heritage. While its direct usage has diminished on systems running systemd, it often persists in compatibility packages (like sysvinit-utils or systemd-sysv) to maintain compatibility with older shutdown scripts and utilities, ensuring that the system's core shutdown procedures remain functional.

SEE ALSO

kill(1), killall(1), pkill(1), shutdown(8), init(8), telinit(8), systemd(1)

Copied to clipboard