Courseiva
easyMultiple ChoiceObjective-mapped

XK0-006 Practice Question: Sarah is a Linux systems administrator for a…

Sarah is a Linux systems administrator for a company that runs a web application inside a Podman container. The container is launched using a systemd service file on a Red Hat Enterprise Linux 8 server. The service file is located at /etc/systemd/system/webapp.service and includes an ExecStart directive that runs `podman run -d --name webapp -p 80:80 nginx`. The server was recently rebooted for kernel updates. After the reboot, the web application is not responding. Sarah logs in and runs `systemctl status webapp.service`, which shows the service is 'disabled' and 'inactive'. She wants to ensure that the container starts automatically after every future reboot. What should Sarah do?

⚠ Common exam trap

Many exam-takers confuse enabling a systemd service with setting a container's restart policy, thinking that `--restart=always` in the Podman command will survive a reboot, when in fact systemd must be enabled to launch the service after boot.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Run `systemctl enable webapp.service` and then start the service.

`systemctl enable webapp.service` creates the necessary symlinks to start the service automatically at boot, and `systemctl start webapp.service` immediately starts the container. Since the service is currently disabled and inactive, enabling it ensures the systemd unit is triggered on future reboots, which will execute the `ExecStart` command to run the Podman container.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Add the line `@reboot /usr/bin/podman start webapp` to root's crontab.

    Why it's wrong here

    Incorrect: This is a workaround, not the standard method, and relies on cron.

  • Modify the container image to include a restart policy of 'always'.

    Why it's wrong here

    Incorrect: Container restart policy does not affect systemd service startup.

  • Run `systemctl enable webapp.service` and then start the service.

    Why this is correct

    Correct: Enabling the systemd service ensures it starts on boot.

  • Run `podman generate systemd --new --name webapp` to create a new systemd unit.

    Why it's wrong here

    Incorrect: The existing unit is fine; generating a new one is unnecessary if the current unit is functional.

About these practice questions

This XK0-006 question is part of Courseiva's 979-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.