EX200 · Question #14
EX200 Question #14: Real Exam Question with Answer & Explanation
Sign in or unlock EX200 to reveal the answer and full explanation for question #14. The question stem and answer options stay visible for context.
Question
14. Configure Container as a Service As the user "wallah," configure a systemd service for the container: - Container name: ascii2pdf - Use the image named pdf created earlier. - Service name: container-ascii2pdf - Automatically start the service on system reboot without manual intervention. - Configure the service to automatically mount /opt/file to /dir1 and /opt/progress to /dir2 in the container upon startup. Correct Answer: See the below explanation Explanation Explanation/Reference: Solution: # Note: Perform the following operations by SSHing into localhost as the user "wallah" [root@node1 ~]# ssh wallah@localhost # Prepare the relevant mapping directories [wallah@node1 ~]$ sudo mkdir /opt/{file,progress} [wallah@node1 ~]$ podman run -d --name ascii2pdf -v /opt/file:/dir1:Z -v /opt/progress:/dir2:Z pdf [wallah@node1 ~]$ podman ps -a # Create systemd service file [wallah@node1 ~]$ mkdir -p ~/.config/systemd/user [wallah@node1 ~]$ cd ~/.config/systemd/user/ [wallah@node1 ~]$ podman generate systemd -n ascii2pdf -f --new [wallah@node1 user]$ ll total 4 -rw-r--r--. 1 wallah wallah 770 Dec 13 01:07 container-ascii2pdf.service # Stop and remove the existing ascii2pdf container [wallah@node1 ~]$ podman stop ascii2pdf [wallah@node1 ~]$ podman rm ascii2pdf [wallah@node1 ~]$ podman ps -a # Enable and start the container-ascii2pdf service [wallah@node1 ~]$ systemctl --user daemon-reload [wallah@node1 ~]$ systemctl --user enable --now container-ascii2pdf # Check container status [wallah@node1 ~]$ systemctl --user status container-ascii2pdf [wallah@node1 ~]$ podman ps # Ensure that the services for the wallah user start automatically at system boot [root@node1 ~]# loginctl enable-linger [root@node1 ~]# loginctl show-user wallah # Check to ensure the container starts on boot (mandatory operation) [root@node1 ~]# reboot [root@node1 ~]# ssh wallah@node1 [wallah@node1 ~]# podman ps
Unlock EX200 to see the answer
You've previewed enough free EX200 questions. Unlock EX200 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.