Sobes.tech
Junior — Middle

What types of signals exist in the Linux operating system?

sobes.tech AI

Answer from AI

In Linux, there are many types of signals used to notify processes of various events. The main types of signals:

  • SIGINT (2) — interrupt the process (usually Ctrl+C in the terminal).
  • SIGTERM (15) — request to terminate the process (can be handled and terminated gracefully).
  • SIGKILL (9) — immediate termination of the process (cannot be caught or ignored).
  • SIGSTOP — pause the process (cannot be caught).
  • SIGCONT — continue a paused process.
  • SIGHUP — hangup signal, often used to reload configuration.
  • SIGUSR1 and SIGUSR2 — user-defined signals for arbitrary use.

Signals can be synchronous (e.g., SIGSEGV on segmentation fault) or asynchronous (e.g., SIGINT from the user). Processes can set signal handlers to perform specific actions upon receiving them.