demo.service is no longer needed.
Stop it now and prevent it from starting at the next boot.
Which command is appropriate?
systemctl disable --now disables boot activation and stops the currently running unit.
Detailed explanation
systemctl disable --now demo.serviceCorrect. It disables automatic start and stops the service now.
Correct. It disables automatic start and stops the service now.
systemctl enable --now demo.serviceIncorrect. enable --now starts and enables the service.
Incorrect. enable --now starts and enables the service.
systemctl reload demo.serviceIncorrect. reload rereads service configuration without stopping or disabling.
Incorrect. reload rereads service configuration without stopping or disabling.
systemctl is-enabled demo.serviceIncorrect. is-enabled only reports state.
Incorrect. is-enabled only reports state.
Try it yourself
An example you can run in a temporary verification environment.
systemctl --help 2>&1 | grep -E -- 'disable|--now' | head -n 3Expected result
disableと--nowに関するhelp行Key points
- disable affects boot
- --now affects current state
- Opposite of enable
Notes
- Environment: systemd systemctl help / unit変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.