That example worked. It turns out I forgot to start the pod. :)
Anyway, I'm still having some issues since I want to use systemd to manage my
containerized services on the host. My current strategy is to use a single service to
manage the pod including the containers. I have the following service file:
[Unit]
Description=Test
Wants=syslog.service
[Service]
Restart=always
ExecStartPre=-/usr/bin/podman stop containerA containerB
ExecStartPre=-/usr/bin/podman pod stop test
ExecStartPre=-/usr/bin/podman rm containerA containerB
ExecStartPre=-/usr/bin/podman pod rm test
ExecStartPre=/usr/bin/podman pod create --name test
ExecStartPre=/usr/bin/podman create --pod test --name containerA imageA
ExecStartPre=/usr/bin/podman create --pod test --name containerB imageB
ExecStart=/usr/bin/podman start test
ExecStop=/usr/bin/podman stop test
[Install]
WantedBy=multi-user.target
It works when I fire off the commands manually, but when I try to start the service it
becomes dead and the pod gets status Exited, killing the two containers inside it.
Again, when I run all the commands from the shell manually the pod comes up fine and runs
without problems. Ideas?