On a legacy SysV-init system, remove legacy.service from runlevel startup.
Do not stop its currently running process.
Which command is appropriate?
In legacy environments, chkconfig SERVICE off changes runlevel startup settings. service stop only affects the current process.
Detailed explanation
service legacy.service stopIncorrect. service stop stops the current service but does not necessarily change boot settings.
Incorrect. service stop stops the current service but does not necessarily change boot settings.
chkconfig legacy.service offCorrect. It disables startup in the legacy configuration.
Correct. It disables startup in the legacy configuration.
chkconfig legacy.service onIncorrect. on enables startup.
Incorrect. on enables startup.
service legacy.service statusIncorrect. status only displays current state.
Incorrect. status only displays current state.
Try it yourself
An example you can run in a temporary verification environment.
chkconfig --help 2>&1 | grep -E -- 'on|off' | head -n 2Expected result
on/offに関するhelp行Key points
- chkconfig off
- Separate from service stop
- SysV management
Notes
- Environment: chkconfig help / service変更なし
- 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.