2023-10-22 18:31:32 +02:00
|
|
|
[Unit]
|
2023-11-11 17:35:09 +01:00
|
|
|
Description=Podman %n
|
2023-10-22 18:31:32 +02:00
|
|
|
Documentation=man:podman-generate-systemd(1)
|
|
|
|
Wants=network.target
|
|
|
|
After=network-online.target
|
|
|
|
BindsTo=pod-metrics.service
|
|
|
|
After=pod-metrics.service
|
|
|
|
OnFailure=status-mail@%n.service
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
Environment=PODMAN_SYSTEMD_UNIT=%n
|
|
|
|
Restart=on-failure
|
|
|
|
TimeoutStopSec=70
|
2023-11-11 17:35:09 +01:00
|
|
|
ExecStartPre=/bin/rm -f %t/%N.pid %t/%N.ctr-id
|
2023-10-22 18:31:32 +02:00
|
|
|
ExecStart=/usr/bin/podman run \
|
2023-11-11 17:35:09 +01:00
|
|
|
--conmon-pidfile %t/%N.pid \
|
|
|
|
--cidfile %t/%N.ctr-id \
|
2023-10-22 18:31:32 +02:00
|
|
|
--cgroups=no-conmon \
|
|
|
|
--pod-id-file %t/pod-metrics.pod-id \
|
|
|
|
--replace \
|
|
|
|
--label "io.containers.autoupdate=image" \
|
|
|
|
--log-driver=journald \
|
|
|
|
-dt \
|
|
|
|
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
|
|
|
|
-v ./.config/service/hosts:/etc/hosts:ro \
|
|
|
|
-v ./.config/service/prometheus.yml:/etc/prometheus/prometheus.yml:U \
|
|
|
|
-v {{ services_data_directory }}/pod-metrics/data/_data:/prometheus:U \
|
2023-11-11 17:35:09 +01:00
|
|
|
--name=%N \
|
2023-10-22 18:31:32 +02:00
|
|
|
docker.io/prom/prometheus:{{ services_service_deploy_versions.prometheus }}
|
2023-11-10 19:17:11 +01:00
|
|
|
# Careful about appending CLI arguments - in addition to the new arguments, all the arguments from
|
|
|
|
# the upstream Dockerfile must also be re-appended and it is not possible it use the configuration
|
|
|
|
# file to configure some arguments: https://github.com/prometheus/prometheus/issues/6188
|
2023-11-11 17:35:09 +01:00
|
|
|
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%N.ctr-id -t 10
|
|
|
|
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%N.ctr-id
|
|
|
|
PIDFile=%t/%N.pid
|
2023-10-22 18:31:32 +02:00
|
|
|
Type=forking
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target default.target
|