Courseiva
Manage containerseasyMultiple ChoiceObjective-mapped

EX200 Manage containers Practice Question

Network Topology
# podman psallRefer to the exhibit.```

A container named 'web1' was created and ran briefly before exiting with status 0. The administrator needs to restart it and attach to the running container's console. Which command should be used?

⚠ Common exam trap

The primary trap is that candidates may think `podman restart` is required to resume an exited container, but `podman start` is the correct command. Additionally, candidates often forget to attach to the console after starting, leading them to choose option B. Note: `podman restart` does work on stopped containers, but it stops and starts the container unnecessarily; `podman start` is the appropriate command for resuming a container that exited with status 0.

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

podman start web1 && podman attach web1

`podman start web1` restarts the existing container that exited with status 0, and `podman attach web1` connects the current terminal to the container's main process console. The `&&` ensures the attach runs only after the container is successfully started, allowing the administrator to interact with the running container's console.

Answer analysis

Option-by-option breakdown

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

  • podman run --name web1 -it registry.access.redhat.com/ubi8/httpd-24

    Why it's wrong here

    The podman run command creates a brand-new container, so attempting to run it again with the same name --name web1 fails with a name-conflict error because the original container still exists in a stopped state. Even if the name did not conflict, this would start a fresh instance and discard the prior container's state, which is not what the scenario asks for. To work with the existing container, you need a lifecycle command like podman start, not run.

  • podman start web1

    Why it's wrong here

    podman start web1 correctly resumes the stopped container, but it does so in the background and returns control to the shell immediately, so you never see the container's console output or are able to send input to it. The request asks for a container that 'ran' and implies you want to reattach to its interactive session; merely starting it without attaching leaves you without any direct interaction. You need to follow up with podman attach web1 to reconnect your terminal to the container's running process.

  • podman restart web1 && podman attach web1

    Why it's wrong here

    The podman restart command is designed to stop and then start a container that is already running or to force a fresh start; however, web1 is currently stopped, so the first command is unnecessary and can even produce an error because restart expects a running container in many workflows. Even if it were allowed, restarting would briefly take the container down and restart its main process, which is more disruptive than simply resuming a stopped container. The correct first step is podman start web1, not restart, and then attaching with podman attach web1.

  • podman start web1 && podman attach web1

    Why this is correct

    This combination first uses podman start web1 to take the existing stopped container and transition it to the running state, preserving its filesystem and configuration. Then podman attach web1 connects your terminal to the container's primary process' STDIN and STDOUT, giving you the same interactive console session that existed when it was originally run. This is the correct lifecycle sequence for resuming an existing interactive container without recreating it.

About these practice questions

This EX200 question is part of Courseiva's 127-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 EX200 practice question is part of Courseiva's free Red Hat 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 EX200 exam.