Which command would you use to verify if a service is enabled to start at boot?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command would you use to verify if a service is enabled to start at boot?

Explanation:
On systemd-based systems, you verify whether a service is configured to start at boot by checking its enablement state with a systemctl command. Running systemctl is-enabled httpd tells you whether the httpd unit is set to be started automatically on boot. It will typically output enabled if a startup link exists, disabled if there isn’t one, and may show static or masked in special cases where the unit isn’t directly enabled but can be started by dependency or is currently blocked. The other options don’t reliably indicate boot-start behavior: systemctl status httpd shows whether the service is running now and may hint at enablement, but it doesn’t definitively tell you if it’s configured to start at boot. chkconfig httpd on is a SysV init tool from older systems and isn’t the right method for a systemd-managed service. systemctl enable httpd would enable the service to start at boot (changing the state), not verify the current enablement.

On systemd-based systems, you verify whether a service is configured to start at boot by checking its enablement state with a systemctl command. Running systemctl is-enabled httpd tells you whether the httpd unit is set to be started automatically on boot. It will typically output enabled if a startup link exists, disabled if there isn’t one, and may show static or masked in special cases where the unit isn’t directly enabled but can be started by dependency or is currently blocked.

The other options don’t reliably indicate boot-start behavior: systemctl status httpd shows whether the service is running now and may hint at enablement, but it doesn’t definitively tell you if it’s configured to start at boot. chkconfig httpd on is a SysV init tool from older systems and isn’t the right method for a systemd-managed service. systemctl enable httpd would enable the service to start at boot (changing the state), not verify the current enablement.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy