# 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 ~]$ sudo chown wallah:wallah /opt/{file,progress} # Start the container and map directories # :Z changes the SELinux security context of the directory to allow container access. [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 # On node1, switch to the root user to perform the following operations # 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