Preventing Automatic Startup of HTTPd Service

Preventing Automatic Startup of HTTPd Service

Question

A configuration management tool running every minute is enforcing the service HTTPd to be started.

To perform maintenance, which of the following series of commands can be used to prevent the service from being started?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

The correct answer is B. systemctl disable httpd && systemctl mask httpd

Explanation: The command "systemctl" is a control utility for the systemd system and service manager. It provides a method for controlling and communicating with the "systemd" process, which is responsible for managing services on a Linux system.

The "disable" command option will stop the service from starting at boot time, meaning that the service will not automatically start when the system is restarted. However, it does not stop the service if it is already running.

The "mask" command option will prevent the service from starting manually or automatically. This will effectively prevent the service from being started, even if it is manually requested or set to start at boot time. The service can only be unmasked by an administrator with root privileges.

Therefore, the correct option to prevent the service from starting temporarily, and even permanently if desired, is to run the command "systemctl disable httpd && systemctl mask httpd". This will disable the service at boot time and prevent it from being started manually or automatically, effectively stopping it from running until the administrator decides to unmask it.