2022-09-26 23:10:48 +02:00
|
|
|
[Unit]
|
2023-07-17 22:31:05 +02:00
|
|
|
Description=Podman pod-{{ services_service_name }}.service
|
2022-09-26 23:10:48 +02:00
|
|
|
Documentation=man:podman-generate-systemd(1)
|
|
|
|
Wants=network.target
|
|
|
|
After=network-online.target
|
2023-11-11 15:01:29 +01:00
|
|
|
Wants=pod-{{ services_service_name }}-nginx.service
|
|
|
|
Before=pod-{{ services_service_name }}-nginx.service
|
2022-10-30 22:09:01 +01:00
|
|
|
OnFailure=status-mail@%n.service
|
2022-09-26 23:10:48 +02:00
|
|
|
|
|
|
|
[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
|
2023-08-18 13:01:36 +02:00
|
|
|
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
|
2023-07-17 22:31:05 +02:00
|
|
|
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'
|
2023-08-13 21:41:47 +02:00
|
|
|
ExecStartPost=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-{{ services_service_name }}
|
|
|
|
ExecStartPost=/usr/bin/sudo /usr/sbin/ifup veth-{{ services_service_name }}
|
|
|
|
ExecStop=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-{{ services_service_name }}
|
2023-07-17 22:31:05 +02:00
|
|
|
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
|
2023-08-13 21:41:47 +02:00
|
|
|
ExecStopPost=/bin/rm -f {{ services_containers_directory }}/pod-{{ services_service_name }}/pidfile
|
2023-07-17 22:31:05 +02:00
|
|
|
PIDFile=%t/pod-{{ services_service_name }}.pid
|
2022-09-26 23:10:48 +02:00
|
|
|
Type=forking
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target default.target
|