Hi,

Hum, maybe you could try to change the ExecLine with
"podman run -d ..."
Instead of "podman start ..." ??

By the way, one advantage of podman is that it is daemonless + rootless. IMHO, you will loose one advantage, except if you put your systemd file in a user define space (eg: /etc/systemd/system/user@.podman.service)

Best regards,
Rémy.

Le sam. 29 juin 2019 à 20:58, Christoffer Reijer <ephracis@gmail.com> a écrit :
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?
_______________________________________________
Podman mailing list -- podman@lists.podman.io
To unsubscribe send an email to podman-leave@lists.podman.io