Check whether web.service is enabled for boot without starting, stopping, or reloading it.
Which command is appropriate?
systemctl is-enabled reports boot activation state; is-active reports the current runtime state.
Detailed explanation
systemctl is-active web.serviceIncorrect. is-active checks whether the service is currently running.
Incorrect. is-active checks whether the service is currently running.
systemctl start web.serviceIncorrect. start changes runtime state.
Incorrect. start changes runtime state.
systemctl is-enabled web.serviceCorrect. It reports whether the unit is enabled.
Correct. It reports whether the unit is enabled.
systemctl reload web.serviceIncorrect. reload asks a running service to reread configuration.
Incorrect. reload asks a running service to reread configuration.
Try it yourself
An example you can run in a temporary verification environment.
systemctl --help 2>&1 | grep -E -- 'is-enabled|is-active' | head -n 2Expected result
is-enabledとis-activeの説明行Key points
- is-enabled is boot configuration
- is-active is current state
- Read-only check
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.