Which command masks a unit, preventing it from being started?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Boost your Linux skills with the CompTIA Linux+ Certification Exam simulator. Engage with multiple choice questions and detailed feedback. Master Linux concepts and prepare for your exam with confidence!

The command "systemctl mask" is used to prevent a unit from being started, either manually or automatically. When a unit is masked, it is effectively linked to /dev/null, making it impossible for the system to start the unit in any way until it is unmasked. This is particularly useful in scenarios where you want to ensure that a specific service remains inactive and cannot be started by other services or dependencies.

In contrast, the other options relate to modifying the behavior of units but do not provide the same level of restriction. For example, "systemctl disable" prevents the unit from starting at boot time but does not stop it from being started manually. Similarly, "systemctl block" and "systemctl prevent" are not valid commands within the systemctl utility, as they do not exist in the systemd command set. Therefore, masking a unit is the most effective means of ensuring it cannot be started in any capacity.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy