Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam XK0-005 topic 1 question 32 discussion

Actual exam question from CompTIA's XK0-005
Question #: 32
Topic #: 1
[All XK0-005 Questions]

A systems administrator has been tasked with disabling the nginx service from the environment to prevent it from being automatically and manually started. Which of the following commands will accomplish this task?

  • A. systemctl cancel nginx
  • B. systemctl disable nginx
  • C. systemctl mask nginx
  • D. systemctl stop nginx
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
BryanSME
5 months ago
https://askubuntu.com/questions/816285/what-is-the-difference-between-systemctl-mask-and-systemctl-disable Disabling the service deletes the symlink, so the unit file itself is not affected, but the service is not loaded at the next boot, when systemd reads /etc/systemd/system. However, a disabled service can be loaded, and will be started if a service that depends on it is started; enable and disable only configure auto-start behaviour for units, and the state is easily overridden. A masked service is one whose unit file is a symlink to /dev/null. This makes it "impossible" to load the service, even if it is required by another, enabled service. When you mask a service, a symlink is created from /etc/systemd/system to /dev/null, leaving the original unit file elsewhere untouched. When you unmask a service the symlink is deleted.
upvoted 1 times
...
Alizadeh
8 months, 1 week ago
Selected Answer: C
The correct answer is C. systemctl mask nginx.
upvoted 1 times
...
BreakOff874
1 year, 1 month ago
Selected Answer: C
systemctl mask will prevent the service from being automatically started by other services.
upvoted 2 times
...
linux_admin
1 year, 2 months ago
Selected Answer: C
Answer B (systemctl disable nginx) and answer C (systemctl mask nginx) both achieve the goal of disabling the nginx service, but they do it in different ways. The systemctl disable nginx command disables the nginx service so that it will not start automatically when the system boots up. However, the service can still be manually started if needed. The systemctl mask nginx command masks the nginx service, which means that it cannot be started, either automatically or manually. This is a more secure option compared to systemctl disable nginx, as it completely prevents the service from being started. In this scenario, either answer B or answer C would be correct, depending on the level of security that the systems administrator wants to enforce. If the administrator wants to prevent the nginx service from starting in any circumstance, then answer C (systemctl mask nginx) is the better choice. If the administrator wants to prevent the nginx service from starting automatically but still allow it to be manually started if needed, then answer B (systemctl disable nginx) is the better choice.
upvoted 3 times
...
KnifeClown1
1 year, 2 months ago
Selected Answer: B
The correct command to disable the nginx service from being automatically and manually started is "systemctl disable nginx". The command "systemctl disable" will disable the service, which means that it will not start automatically during boot and will not be able to be started manually. The "systemctl stop nginx" command will only stop the service if it is currently running, but will not prevent it from being started again in the future. The "systemctl cancel nginx" and "systemctl mask nginx" commands are not commonly used and will not accomplish the task of disabling the nginx service.
upvoted 1 times
KnifeClown1
1 year, 2 months ago
Correct answer = C
upvoted 2 times
...
...
Notnotataco
1 year, 4 months ago
Should the answer be B? Based on my reading, it looks like B would be the best choice.
upvoted 1 times
TheRealManish
1 year, 4 months ago
enable/disable just says what should happen at boot. it will not step a user or service from manually executing like mask will
upvoted 1 times
...
Veteran903
1 year, 4 months ago
hello, please, read the question again, you may not be understanding what they are asking, Comptia wording is brutal so be careful.You can manually start a disabled service with the systemctl start command after the system boots, to prevent this, you must use the mask subcommand, masking the service links its configuration to /dev/null. A user or process will not be able to start this service at all (whereas with a disabled service, a user or process can still start it). Use the unmask subcommand to reverse the setting: Ex: $ sudo systemctl mask sshd
upvoted 3 times
Notnotataco
1 year, 4 months ago
I'm an idiot lol....thank you all!!!!
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...