After modifying the ExecStart line of a custom systemd service unit file and running systemctl daemon-reload, the administrator wants the change to take effect immediately. The solution must stop the unit and then start it again even if it is currently inactive, using a single command. Which systemctl subcommand accomplishes this requirement?
The restart subcommand always stops the specified unit and then starts it again. If the unit is not running, it is started; if it is running, it is first terminated and then launched with the updated parameters, guaranteeing that the new ExecStart directive is used.
reload merely instructs the running process to reread its own application-level configuration and never replaces the binary or reads unit-file changes.
try-restart performs a stop/start cycle only when the unit is already active; if it is inactive, nothing happens.
reload-or-restart attempts a reload; if that succeeds the unit is not stopped, so an updated ExecStart line would still be ignored. Therefore, systemctl restart is the only option that unconditionally applies the unit-file modifications.
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 is the purpose of `systemctl daemon-reload`?
Open an interactive chat with Bash
What is the key difference between `restart` and `reload` in systemd?
Open an interactive chat with Bash
When should you use `try-restart` instead of `restart`?
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