exam questions

Exam XK0-004 All Questions

View all questions & answers for the XK0-004 exam

Exam XK0-004 topic 1 question 125 discussion

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

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
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
betty_boop
Highly Voted 4 years, 4 months ago
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.
upvoted 9 times
...
luken7777
Most Recent 1 year, 9 months ago
it will be B and C. When you use systemctl stop it will stop the service only in the current session, not after rebooting. To completely stop it from running automatically you have to use systemctl disable and then systemctl mask.
upvoted 1 times
...
wait4thebus
2 years, 3 months ago
Just to be clear, answer A) is correct because: 1) you must first stop the service with "systemctl stop httpd" 2) the "&&" waits for the service stop to complete to close httpd gracefully 3) "systemctl mask httpd" then completely disables the service from starting on reboot or having someone start it manually at any time. Lastly, there is NO hide command in any of the major Linux distributions that I have seen, so C cannot be right.
upvoted 1 times
...
examtopics_htc
2 years, 6 months ago
Selected Answer: A
Stop the service, then mask it
upvoted 3 times
...
xeun88
2 years, 6 months ago
A is the correct answer, you stop and mask
upvoted 1 times
...
Didi31
3 years, 3 months ago
Stop the service before you can mask it.
upvoted 1 times
...
DBB73
3 years, 6 months ago
...you have to stop the service before you can mask it.
upvoted 3 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago