Linux Foundation Certified System Administrator: Signal Sent to Process on CTRL+C Keypress

Signal Sent to Process on CTRL+C Keypress

Question

Which of the following signals is sent to a process when the key combination CTRL+C is pressed on the keyboard?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B

When a user presses the Ctrl + C key combination, a signal is sent to the current foreground process running in the terminal. The default signal that is sent to the process is SIGINT (signal interrupt), which requests the process to terminate gracefully.

The SIGINT signal is a user-initiated interrupt signal that is sent by the terminal driver to the foreground process in response to the Ctrl + C key combination. The process can then handle the signal by terminating gracefully or performing any other cleanup operations before terminating.

The SIGTERM signal, on the other hand, is a general-purpose signal that can be sent to any process to request it to terminate gracefully. Unlike SIGINT, SIGTERM is not initiated by the user through a keyboard interrupt. Instead, it can be sent by another process, such as a system shutdown script or a process manager.

The SIGSTOP signal is used to pause a process temporarily, while the SIGKILL signal is used to force a process to terminate immediately, without giving it a chance to clean up or save its state.

In summary, the answer to the question is B. SIGINT. When the user presses the Ctrl + C key combination, the SIGINT signal is sent to the current foreground process, requesting it to terminate gracefully.