nerdexam
CompTIA

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.

System Management

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)
  • A
    2% (1)
  • B
    7% (3)
  • C
    2% (1)
  • D
    88% (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.

AKilling the parent process with -15 gives it a chance to kill all of the 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.

BThe -15 signal will allow the kill command to automatically seek out all child processes and kill

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.

CThe -15 signal tells the command to kill all processes matching the Apache string.

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.

DThe -15 signal gracefully kills the process and all Its parent and child processes.Correct

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

#Linux processes#Signal handling#Graceful shutdown#Web server management

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice