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

29 lines
1.5 KiB
SYSTEMD
Raw Normal View History

2022-10-24 00:45:52 +02:00
[Unit]
Description=Podman pod-database.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
2023-08-17 17:09:30 +02:00
Requires=container-database-postgres.service container-database-pgadmin.service
Before=container-database-postgres.service container-database-pgadmin.service
OnFailure=status-mail@%n.service
2022-10-24 00:45:52 +02:00
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-database.pid %t/pod-database.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-database.pid --pod-id-file %t/pod-database.pod-id --name=database --network=none --replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-database.pod-id
2022-12-18 00:05:58 +01:00
ExecStartPost=/usr/bin/sh -c 'podman inspect --format "{% raw %}{{ .State.Pid }}{% endraw %}" $(podman inspect --format "{% raw %}{{ .InfraContainerID }}{% endraw %}" database) > {{ services_containers_directory }}/pod-database/pidfile'
ExecStartPost=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-database
ExecStartPost=/usr/bin/sudo /usr/sbin/ifup veth-database
ExecStop=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-database
2022-10-24 00:45:52 +02:00
ExecStop=/usr/bin/podman pod stop --ignore --pod-id-file %t/pod-database.pod-id -t 10
ExecStopPost=/usr/bin/podman pod rm --ignore -f --pod-id-file %t/pod-database.pod-id
ExecStopPost=/bin/rm -f {{ services_containers_directory }}/pod-database/pidfile
2022-10-24 00:45:52 +02:00
PIDFile=%t/pod-database.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target