ansible-edda/playbooks/roles/services/deploy/rproxy/templates/systemd/pod-rproxy.service

25 lines
1.4 KiB
SYSTEMD
Raw Normal View History

[Unit]
2023-07-17 22:31:05 +02:00
Description=Podman pod-{{ services_service_name }}.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
2023-07-17 22:31:05 +02:00
Requires=container-{{ services_service_name }}-nginx.service
Before=container-{{ services_service_name }}-nginx.service
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
2023-07-17 22:31:05 +02:00
ExecStartPre=/bin/rm -f %t/pod-{{ services_service_name }}.pid %t/pod-{{ services_service_name }}.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-{{ services_service_name }}.pid --pod-id-file %t/pod-{{ services_service_name }}.pod-id --name={{ services_service_name }} --network=none --replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-{{ services_service_name }}.pod-id
ExecStartPost=/usr/bin/sh -c 'podman inspect --format "{% raw %}{{ .State.Pid }}{% endraw %}" $(podman inspect --format "{% raw %}{{ .InfraContainerID }}{% endraw %}" {{ services_service_name }}) > {{ services_containers_directory }}/pod-{{ services_service_name }}/pidfile'
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-{{ services_service_name }}.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-{{ services_service_name }}.pod-id
PIDFile=%t/pod-{{ services_service_name }}.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target