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

34 lines
1.3 KiB
SYSTEMD
Raw Normal View History

2023-10-22 18:31:32 +02:00
[Unit]
Description=Podman %n
2023-10-22 18:31:32 +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-dash-grafana.service
Before=pod-dash-grafana.service
2023-10-22 18:31:32 +02:00
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/%N.pid %t/%N.pod-id
2023-10-22 18:31:32 +02:00
ExecStartPre=/usr/bin/podman pod create \
--infra-conmon-pidfile %t/%N.pid \
--pod-id-file %t/%N.pod-id \
--name=%N \
2023-10-22 18:31:32 +02:00
--network=none \
--replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/%N.pod-id
ExecStartPost=/usr/bin/sh -c 'podman inspect --format "{% raw %}{{ .State.Pid }}{% endraw %}" $(podman pod inspect --format "{% raw %}{{ .InfraContainerID }}{% endraw %}" %N) > {{ services_containers_directory }}/%N/pidfile'
2023-10-22 18:31:32 +02:00
ExecStartPost=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-dash
ExecStartPost=/usr/bin/sudo /usr/sbin/ifup veth-dash
ExecStop=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-dash
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/%N.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/%N.pod-id
ExecStopPost=/bin/rm -f {{ services_containers_directory }}/%N/pidfile
PIDFile=%t/%N.pid
2023-10-22 18:31:32 +02:00
Type=forking
[Install]
WantedBy=multi-user.target default.target