XK0-005 · Question #332
A systems administrator is editing a service file for the web server. In order to continue testing, all web server processes must be shut down. The administrator accomplishes this with the following…
The correct answer is D. The -15 signal gracefully kills the process and all Its parent and child processes. The -15 signal (SIGTERM) is used to gracefully request a process to terminate, allowing it to perform cleanup and properly shut down its child processes.
Question
A systems administrator is editing a service file for the web server. In order to continue testing, all web server processes must be shut down. The administrator accomplishes this with the following commands:
Based on the command output above, which of the following BEST explains how this was accomplished?
Options
- AKilling the parent process with -15 gives it a chance to kill all of the child processes.
- BThe -15 signal will allow the kill command to automatically seek out all child processes and kill
- CThe -15 signal tells the command to kill all processes matching the Apache string.
- DThe -15 signal gracefully kills the process and all Its parent and child processes.
How the community answered
(41 responses)- A2% (1)
- B7% (3)
- C2% (1)
- D88% (36)
Why each option
The -15 signal (SIGTERM) is used to gracefully request a process to terminate, allowing it to perform cleanup and properly shut down its child processes.
While sending -15 to a parent gives it a chance to kill children, option D is more comprehensive by stating it gracefully kills the process itself and all its related processes, implying a complete, controlled shutdown.
The kill command itself does not automatically seek out child processes; rather, the process receiving the SIGTERM signal is responsible for handling its children or the operating system cleans up orphaned processes.
Sending -15 does not inherently tell the command to kill all processes matching a string; that functionality is provided by commands like killall or pkill, not the signal itself or a simple kill PID.
The -15 signal (SIGTERM) is a request for a process to terminate gracefully. When a well-behaved parent process, like a web server, receives SIGTERM, it attempts to clean up its resources, save its state, and properly terminate its child processes before exiting itself. This ensures a controlled shutdown of the entire application hierarchy, including parent and child processes.
Concept tested: Linux process management, SIGTERM signal
Source: https://man7.org/linux/man-pages/man7/signal.7.html
Topics
Community Discussion
No community discussion yet for this question.