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?
A. systemctl stop httpd && systemctl mask httpd
B. systemctl disable httpd && systemctl mask httpd
C. systemctl stop httpd && systemctl hide httpd
D. systemctl disable httpd && systemctl hide httpd
Call me crazy but isn’t the answer: B. systemctl disable httpd && systemctl mask httpd.
They said “can be used to ‘prevent’ the service ‘from being started’?”
I assume prevent from being started means to disable, in which you can run the following:
systemctl disable httpd
systemctl mask httpd
The question isn’t asking you to disable the service right now, if it was then I’d agree the answer would be A with the “stop” parameter… Any thoughts?
Gotta say I think your right, it does say prevent it from starting. Disable ensures it can’t be started, and mask does the same on reboot. Link for proof.
https://askubuntu.com/questions/816285/what-is-the-difference-between-systemctl-mask-and-systemctl-disable