A few hours later another administrator accidentally starts the service again with systemctl start vsftpd.service. You must issue one command that immediately stops the service if it is running and guarantees that no user, socket, or dependent unit can start it again until you decide otherwise. Which command achieves this goal?
The mask subcommand creates a symbolic link from the unit name in /etc/systemd/system (or /run/systemd/system with --runtime) to /dev/null. Because the file now points to /dev/null, systemd refuses any attempt-manual or automatic-to start the unit. Adding the --now option stops the unit first and then applies the mask, accomplishing both requirements in a single step.
disable --now stops the service and removes the boot-time symlinks, but the unit can still be started manually or by dependency. preset merely sets the enable state to the vendor's default and does not block manual starts. daemon-reload only makes systemd reread unit files; it does not affect the ability to start the service.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does 'masking' a service with Systemd do?
Open an interactive chat with Bash
How is 'mask' different from 'disable' in Systemd?
Open an interactive chat with Bash
What is the purpose of the `--now` option in Systemd commands?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access