Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

5 Commits

Repository files navigation

killgracefully

Script to kill a process gracefully

Usage

killgracefully - Send signals to kill gracefully a process

Usage: ./killgracefully.sh [-v...] ( [-h|-V] | [-t S] [-N] -p PID )

Options:

-h, --help Show this help.
-V, --version Show version.
-v, --verbose Turn verbose mode on (cumulative).
-t S, --time S Set the interval between signals in seconds. (default 5s)
-p PID, --pid PID Set the PID of the process to kill gracefully
-N, -s N, --sigs N Set the numbers of signals to try. The order is:
-1 SIGKILL
-2 SIGTERM, SIGKILL
-3 SIGTERM, SIGINT, SIGKILL
-4 SIGTERM, SIGINT, SIGQUIT, SIGKILL (default) -5 SIGTERM, SIGINT, SIGQUIT, SIGABRT, SIGKILL 

Signals used

Table of signals with default action of terminate (with or without core dump)

SignalValueActionComment
SIGTERM15TermTermination signal
SIGINT2TermFamous CONTROL+C interrupt from keyboard
SIGQUIT3CoreCONTRL+\ or quit from keyboard
SIGABRT6CoreAbort signal
SIGKILL9TermKill signal

Exit status

  • 0, if ok.
  • 1, if some error occurred (mainly about the usage)

About

Script to kill a process gracefully

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages