nerdexam
CompTIA

XK0-004 · 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 c

The correct answer is D. The -15 signal gracefully kills the process and all Its parent and child processes.. SIGTERM (-15) is the graceful termination signal that allows a process to clean up and shut down its entire process group, including child workers.

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?

Exhibit

XK0-004 question #332 exhibit

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

(61 responses)
  • A
    15% (9)
  • B
    5% (3)
  • C
    8% (5)
  • D
    72% (44)

Why each option

SIGTERM (-15) is the graceful termination signal that allows a process to clean up and shut down its entire process group, including child workers.

AKilling the parent process with -15 gives it a chance to kill all of the child processes.

The phrasing is misleading - SIGTERM does not give the kill command a special ability; rather, the parent process itself decides to terminate its children as part of its own graceful shutdown handler.

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

The kill command with -15 sends SIGTERM only to the explicitly specified PID and does not automatically seek or enumerate child processes - that responsibility belongs to the parent process's signal handler.

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

Signal -15 is the SIGTERM signal number and is unrelated to name-based pattern matching; tools like killall or pkill are required to target processes by name.

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

Sending signal -15 (SIGTERM) to a parent server process like Apache instructs it to terminate gracefully - the parent process handles its own cleanup and signals all child worker processes to exit as well, resulting in a complete, orderly shutdown of every process in that service tree.

Concept tested: SIGTERM graceful process and child termination

Source: https://man7.org/linux/man-pages/man7/signal.7.html

Topics

#SIGTERM#kill signal#process management#parent child processes

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice