On a systemd host, telnet.service is active and enabled at boot.
Stop it now and prevent it from starting at the next boot.
Which command is appropriate?
systemctl disable --now removes the enablement link and stops the unit immediately. Socket activation may require checking a related socket unit too.
Detailed explanation
systemctl stop telnet.serviceIncorrect. stop does not change the boot-time enablement.
Incorrect. stop does not change the boot-time enablement.
systemctl disable telnet.serviceIncorrect. disable changes boot-time activation but does not stop the active service.
Incorrect. disable changes boot-time activation but does not stop the active service.
systemctl reload telnet.serviceIncorrect. reload rereads service configuration without stopping or disabling it.
Incorrect. reload rereads service configuration without stopping or disabling it.
systemctl disable --now telnet.serviceCorrect. It disables boot activation and stops the current service.
Correct. It disables boot activation and stops the current service.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s
' 'disable=remove enablement links' '--now=also stop unit now'Expected result
disable=remove enablement links
--now=also stop unit nowKey points
- Combine stop and disable
- Use --now
- Check socket or other activation paths
Notes
- Environment: systemctl構文対応表(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.