GSEC practice question 28 of 35

You work as a Network Administrator for World Perfect Inc. The company has a Linux-based network. You have configured a Linux Web server on the…

Full set: 383 questions

Domain Linux: Security and Administration

You work as a Network Administrator for World Perfect Inc. The company has a Linux-based network. You have configured a Linux Web server on the network. A user complains that the Web server is not responding to requests. The process list on the server shows multiple instances of the HTTPD process. You are required to stop the Web service. Which of the following commands will you use to resolve the issue?
Answer options
A: killall httpd Correct answer
B: endall httpd
C: kill httpd
D: end httpd
Correct Answer:
A. killall httpd
Explanation

The killall command is the correct tool for this scenario. It is designed to terminate all running processes that match a specific name. Since the server has multiple instances of the httpd process, killall httpd will send a termination signal (SIGTERM by default) to every one of them, effectively stopping the web service. This command is more efficient than finding and killing each process individually by its Process ID (PID).

Why Incorrect

B. endall httpd: endall is not a standard or valid command in the Linux operating system for process management.
C. kill httpd: The kill command requires a numeric Process ID (PID) as its argument, not a process name like httpd.
D. end httpd: end is not a standard or valid command in the Linux operating system for process management. ---

References

1. Red Hat Enterprise Linux 8 Documentation. "Configuring basic system settings

" Chapter 9. Managing processes

Section 9.4.2. Terminating a process by name. The documentation explicitly states

"To terminate a process by name

use the killall command

" and provides the example: $ killall httpd.

2. The Linux killall(1) man page. The official manual page for the command describes its function as to "kill processes by name." It confirms that the command sends a signal to all processes running any of the specified command names.

3. MIT OpenCourseWare. "The Missing Semester of Your CS Education" (January 2020)

Lecture 2: Shell Tools and Scripting. The lecture notes on process management introduce kill for terminating processes via PID and mention pkill and killall as more convenient alternatives that can operate on process names.

Scroll to Top