From 8c478fccb845b6f574b6bdf0a08c73eb09a40da2 Mon Sep 17 00:00:00 2001 From: Vitor Henrique <87824454+vitorhcl@users.noreply.github.com> Date: Tue, 9 Jan 2024 05:50:21 -0300 Subject: [PATCH] kill: split POSIX and util-linux implementations (#12044) --- pages/common/kill.md | 6 +----- pages/linux/kill.md | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 pages/linux/kill.md diff --git a/pages/common/kill.md b/pages/common/kill.md index 75ae8de28..6f8bf24b6 100644 --- a/pages/common/kill.md +++ b/pages/common/kill.md @@ -2,7 +2,7 @@ > Sends a signal to a process, usually related to stopping the process. > All signals except for SIGKILL and SIGSTOP can be intercepted by the process to perform a clean exit. -> More information: . +> More information: . - Terminate a program using the default SIGTERM (terminate) signal: @@ -12,10 +12,6 @@ `kill -l` -- Terminate a background job: - -`kill %{{job_id}}` - - Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating: `kill -{{1|HUP}} {{process_id}}` diff --git a/pages/linux/kill.md b/pages/linux/kill.md new file mode 100644 index 000000000..fe9c3d4bd --- /dev/null +++ b/pages/linux/kill.md @@ -0,0 +1,37 @@ +# kill + +> Sends a signal to a process, usually related to stopping the process. +> All signals except for SIGKILL and SIGSTOP can be intercepted by the process to perform a clean exit. +> More information: . + +- Terminate a program using the default SIGTERM (terminate) signal: + +`kill {{process_id}}` + +- List signal values and their corresponding names (to be used without the `SIG` prefix): + +`kill -{{L|-table}}` + +- Terminate a background job: + +`kill %{{job_id}}` + +- Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating: + +`kill -{{1|HUP}} {{process_id}}` + +- Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl + C`: + +`kill -{{2|INT}} {{process_id}}` + +- Signal the operating system to immediately terminate a program (which gets no chance to capture the signal): + +`kill -{{9|KILL}} {{process_id}}` + +- Signal the operating system to pause a program until a SIGCONT ("continue") signal is received: + +`kill -{{17|STOP}} {{process_id}}` + +- Send a `SIGUSR1` signal to all processes with the given GID (group id): + +`kill -{{SIGUSR1}} -{{group_id}}`