Which command enables a service to start at boot and also starts it immediately, and then allows you to verify its enabled state and status?

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 enables a service to start at boot and also starts it immediately, and then allows you to verify its enabled state and status?

Explanation:
The key idea is using the enable command with the --now option. That single command makes the service start right away and also configures it to start automatically at boot. After doing that, you can verify two things: is-enabled checks whether the service is set to start on boot, and status shows the current running state of the service. By running enable --now first, you ensure the service is active now and will be active on subsequent boots. Then checking is-enabled confirms the boot-time setting, and status confirms that the service is actually running. Other sequences might check status before enabling (which could show the service as inactive) or separate the start and enable actions, which is less direct for achieving both goals in one step.

The key idea is using the enable command with the --now option. That single command makes the service start right away and also configures it to start automatically at boot. After doing that, you can verify two things: is-enabled checks whether the service is set to start on boot, and status shows the current running state of the service. By running enable --now first, you ensure the service is active now and will be active on subsequent boots. Then checking is-enabled confirms the boot-time setting, and status confirms that the service is actually running. Other sequences might check status before enabling (which could show the service as inactive) or separate the start and enable actions, which is less direct for achieving both goals in one step.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy