Search code examples
supervisord

Differences of the supervisord stopsignal options


In the documentation of supervisord they mention a list of different stopsignals: TERM, HUP, INT, QUIT, KILL, USR1, USR2

What are the detailed differences of these stop signals? I got a scenario where I would like to send a signal equalling a keyboard interrupt to the process that is supposed to be stopped. Which of the above would be the right one?


Solution

  • I believe those options refer to Linux Signals. You can read more on the man pages - https://man7.org/linux/man-pages/man7/signal.7.html or check out this more descriptive article which the below table was taken from - https://www.computerhope.com/unix/signals.htm

    As the man-pages detail, SIGINT (INT) would be the right choice to signal an Interrupt from keyboard.

    Signal Description
    SIGTERM The TERM signal is sent to a process to request its termination. Unlike the KILL signal, it can be caught and interpreted or ignored by the process. This signal allows the process to perform nice termination releasing resources and saving state if appropriate. It should be noted that SIGINT is nearly identical to SIGTERM.
    SIGHUP The HUP signal is sent to a process when its controlling terminal is closed. It was originally designed to notify a serial line drop (HUP stands for "Hang Up"). In modern systems, this signal usually indicates the controlling pseudo or virtual terminal is closed.
    SIGINT The INT signal is sent to a process by its controlling terminal when a user wants to interrupt the process. This signal is often initiated by pressing Ctrl+C, but on some systems, the "delete" character or "break" key can be used.
    SIGQUIT The QUIT signal is sent to a process by its controlling terminal when the user requests that the process perform a core dump.
    SIGKILL Forcefully terminate a process. With STOP, this is one of two signals which cannot be intercepted, ignored, or handled by the process itself.
    SIGUSR1 User-defined signal 1. This is one of two signals designated for custom user signal handling.
    SIGUSR2 User-defined signal 2. This is one of two signals designated for custom user signal handling.