nerdexam
Linux_Foundation

LFCS · Question #727

Which of the following commands kills the process with the PID 123 but allows the process to "clean up" before exiting?

The correct answer is D. kill -TERM 123. To gracefully terminate a process and allow it to perform cleanup tasks, the kill command should be used with the SIGTERM signal.

Submitted by brentm· Apr 18, 2026Operation of Running Systems

Question

Which of the following commands kills the process with the PID 123 but allows the process to "clean up" before exiting?

Options

  • Akill -PIPE 123
  • Bkill -KILL 123
  • Ckill -STOP 123
  • Dkill -TERM 123

How the community answered

(26 responses)
  • A
    4% (1)
  • B
    4% (1)
  • D
    92% (24)

Why each option

To gracefully terminate a process and allow it to perform cleanup tasks, the `kill` command should be used with the `SIGTERM` signal.

Akill -PIPE 123

There is no standard `SIGPIPE` signal intended for process termination; `SIGPIPE` typically occurs when writing to a pipe or socket with no reader.

Bkill -KILL 123

The `kill -KILL` command sends the `SIGKILL` signal (signal 9), which immediately terminates a process without allowing it to perform any cleanup operations, as it cannot be caught or ignored.

Ckill -STOP 123

The `kill -STOP` command sends the `SIGSTOP` signal (signal 19), which pauses or suspends a process without terminating it, allowing it to be resumed later with `SIGCONT`.

Dkill -TERM 123Correct

The `kill -TERM` command sends the `SIGTERM` signal (signal 15) to a process, which is a request for graceful termination. This allows the process to catch the signal, close files, save state, and exit cleanly.

Concept tested: Process signal handling (graceful termination)

Source: https://man7.org/linux/man-pages/man1/kill.1.html

Topics

#Process Management#Signals#kill command#Graceful Termination

Community Discussion

No community discussion yet for this question.

Full LFCS Practice