CompTIA Linux+ (XK0-004) — Question 228
A systems administrator discovers httpd is running and preventing another application service from listening on the default web port. The administrator stops and disables the httpd service and then the application works. The administrator, however, discovers httpd is running again after reboot.
Given this behavior, which of the following will prevent httpd from starting on boot?
Answer options
- A. systemctl mask httpd
- B. systemctl blame httpd
- C. systemctl disable httpd
- D. systemctl stop httpd
Correct answer: C
Explanation
The correct answer is C, as using 'systemctl disable httpd' ensures that the httpd service does not start during the boot process. Option A, 'systemctl mask httpd', would also prevent it from starting but is a more extreme measure typically used for services that should never run. Option B, 'systemctl blame httpd', is not relevant to stopping the service at boot, as it simply shows the time taken by services during boot. Option D, 'systemctl stop httpd', only stops the service temporarily but does not prevent it from starting again after a reboot.