Tidy up systemd files

This commit is contained in:
Wojciech Kozlowski 2023-10-01 19:08:06 +02:00
parent a764f3fcea
commit 4074a45983
6 changed files with 67 additions and 53 deletions

View File

@ -12,7 +12,12 @@ Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure Restart=on-failure
TimeoutStopSec=70 TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-database.pid %t/pod-database.pod-id 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 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 ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-database.pod-id
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/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/ifdown --ignore-errors veth-database

View File

@ -13,24 +13,24 @@ Restart=on-failure
TimeoutStopSec=70 TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-music-archive.pid %t/container-music-archive.ctr-id ExecStartPre=/bin/rm -f %t/container-music-archive.pid %t/container-music-archive.ctr-id
ExecStart=/usr/bin/podman run \ ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-music-archive.pid \ --conmon-pidfile %t/container-music-archive.pid \
--cidfile %t/container-music-archive.ctr-id \ --cidfile %t/container-music-archive.ctr-id \
--cgroups=no-conmon \ --cgroups=no-conmon \
--pod-id-file %t/pod-music.pod-id \ --pod-id-file %t/pod-music.pod-id \
--replace \ --replace \
--label "io.containers.autoupdate=image" \ --label "io.containers.autoupdate=image" \
--log-driver=journald \ --log-driver=journald \
-dt \ -dt \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \ -v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
-v {{ services_data_directory }}/pod-music/archive/_data:/data \ -v {{ services_data_directory }}/pod-music/archive/_data:/data \
-v {{ services_host_services[services_service_name].archive_path }}:/music:ro \ -v {{ services_host_services[services_service_name].archive_path }}:/music:ro \
-e ND_PORT="8080" \ -e ND_PORT="8080" \
-e ND_IGNOREDARTICLES="The El La Los Las Le Les Os O A" \ -e ND_IGNOREDARTICLES="The El La Los Las Le Les Os O A" \
-e ND_ENABLESTARRATING="false" \ -e ND_ENABLESTARRATING="false" \
-e ND_LASTFM_ENABLED="false" \ -e ND_LASTFM_ENABLED="false" \
-e ND_PASSWORDENCRYPTIONKEY={{ services[services_service_name].password_encryption_key }} \ -e ND_PASSWORDENCRYPTIONKEY={{ services[services_service_name].password_encryption_key }} \
--name=pod-music-archive \ --name=pod-music-archive \
docker.io/deluan/navidrome:{{ services_service_deploy_versions.navidrome }} docker.io/deluan/navidrome:{{ services_service_deploy_versions.navidrome }}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-music-archive.ctr-id -t 10 ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-music-archive.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-music-archive.ctr-id ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-music-archive.ctr-id
PIDFile=%t/container-music-archive.pid PIDFile=%t/container-music-archive.pid

View File

@ -13,24 +13,24 @@ Restart=on-failure
TimeoutStopSec=70 TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-music-collection.pid %t/container-music-collection.ctr-id ExecStartPre=/bin/rm -f %t/container-music-collection.pid %t/container-music-collection.ctr-id
ExecStart=/usr/bin/podman run \ ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-music-collection.pid \ --conmon-pidfile %t/container-music-collection.pid \
--cidfile %t/container-music-collection.ctr-id \ --cidfile %t/container-music-collection.ctr-id \
--cgroups=no-conmon \ --cgroups=no-conmon \
--pod-id-file %t/pod-music.pod-id \ --pod-id-file %t/pod-music.pod-id \
--replace \ --replace \
--label "io.containers.autoupdate=image" \ --label "io.containers.autoupdate=image" \
--log-driver=journald \ --log-driver=journald \
-dt \ -dt \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \ -v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
-v {{ services_data_directory }}/pod-music/collection/_data:/data \ -v {{ services_data_directory }}/pod-music/collection/_data:/data \
-v {{ services_host_services[services_service_name].collection_path }}:/music:ro \ -v {{ services_host_services[services_service_name].collection_path }}:/music:ro \
-e ND_PORT="80" \ -e ND_PORT="80" \
-e ND_IGNOREDARTICLES="The El La Los Las Le Les Os O A" \ -e ND_IGNOREDARTICLES="The El La Los Las Le Les Os O A" \
-e ND_ENABLESTARRATING="false" \ -e ND_ENABLESTARRATING="false" \
-e ND_LASTFM_ENABLED="false" \ -e ND_LASTFM_ENABLED="false" \
-e ND_PASSWORDENCRYPTIONKEY={{ services[services_service_name].password_encryption_key }} \ -e ND_PASSWORDENCRYPTIONKEY={{ services[services_service_name].password_encryption_key }} \
--name=pod-music-collection \ --name=pod-music-collection \
docker.io/deluan/navidrome:{{ services_service_deploy_versions.navidrome }} docker.io/deluan/navidrome:{{ services_service_deploy_versions.navidrome }}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-music-collection.ctr-id -t 10 ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-music-collection.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-music-collection.ctr-id ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-music-collection.ctr-id
PIDFile=%t/container-music-collection.pid PIDFile=%t/container-music-collection.pid

View File

@ -12,7 +12,12 @@ Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure Restart=on-failure
TimeoutStopSec=70 TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-music.pid %t/pod-music.pod-id ExecStartPre=/bin/rm -f %t/pod-music.pid %t/pod-music.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-music.pid --pod-id-file %t/pod-music.pod-id --name=music --network=none --replace ExecStartPre=/usr/bin/podman pod create \
--infra-conmon-pidfile %t/pod-music.pid \
--pod-id-file %t/pod-music.pod-id \
--name=music \
--network=none \
--replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-music.pod-id ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-music.pod-id
ExecStartPost=/usr/bin/sh -c 'podman inspect --format "{% raw %}{{ .State.Pid }}{% endraw %}" $(podman inspect --format "{% raw %}{{ .InfraContainerID }}{% endraw %}" music) > {{ services_containers_directory }}/pod-music/pidfile' ExecStartPost=/usr/bin/sh -c 'podman inspect --format "{% raw %}{{ .State.Pid }}{% endraw %}" $(podman inspect --format "{% raw %}{{ .InfraContainerID }}{% endraw %}" music) > {{ services_containers_directory }}/pod-music/pidfile'
ExecStartPost=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-music ExecStartPost=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-music

View File

@ -13,19 +13,18 @@ Restart=on-failure
TimeoutStopSec=70 TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/container-www-nginx.pid %t/container-www-nginx.ctr-id ExecStartPre=/bin/rm -f %t/container-www-nginx.pid %t/container-www-nginx.ctr-id
ExecStart=/usr/bin/podman run \ ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/container-www-nginx.pid \ --conmon-pidfile %t/container-www-nginx.pid \
--cidfile %t/container-www-nginx.ctr-id \ --cidfile %t/container-www-nginx.ctr-id \
--cgroups=no-conmon \ --cgroups=no-conmon \
--pod-id-file \ --pod-id-file %t/pod-www.pod-id \
%t/pod-www.pod-id \ --replace \
--replace \ --label "io.containers.autoupdate=image" \
--label "io.containers.autoupdate=image" \ --log-driver=journald \
--log-driver=journald \ -dt \
-dt \ -v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \ -v ./.config/service/wojciechkozlowski.eu/public:/usr/share/nginx/html:ro \
-v ./.config/service/wojciechkozlowski.eu/public:/usr/share/nginx/html:ro \ --name=pod-www-nginx \
--name=pod-www-nginx \ docker.io/library/nginx:{{ services_service_deploy_versions.nginx }}
docker.io/library/nginx:{{ services_service_deploy_versions.nginx }}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-www-nginx.ctr-id -t 10 ExecStop=/usr/bin/podman stop --ignore --cidfile %t/container-www-nginx.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-www-nginx.ctr-id ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/container-www-nginx.ctr-id
PIDFile=%t/container-www-nginx.pid PIDFile=%t/container-www-nginx.pid

View File

@ -12,9 +12,14 @@ Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure Restart=on-failure
TimeoutStopSec=70 TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-www.pid %t/pod-www.pod-id ExecStartPre=/bin/rm -f %t/pod-www.pid %t/pod-www.pod-id
ExecStartPre=/usr/bin/podman pod create --infra-conmon-pidfile %t/pod-www.pid --pod-id-file %t/pod-www.pod-id --name=rproxy --network=none --replace ExecStartPre=/usr/bin/podman pod create \
--infra-conmon-pidfile %t/pod-www.pid \
--pod-id-file %t/pod-www.pod-id \
--name=www \
--network=none \
--replace
ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-www.pod-id ExecStart=/usr/bin/podman pod start --pod-id-file %t/pod-www.pod-id
ExecStartPost=/usr/bin/sh -c 'podman inspect --format "{% raw %}{{ .State.Pid }}{% endraw %}" $(podman inspect --format "{% raw %}{{ .InfraContainerID }}{% endraw %}" rproxy) > {{ services_containers_directory }}/pod-www/pidfile' ExecStartPost=/usr/bin/sh -c 'podman inspect --format "{% raw %}{{ .State.Pid }}{% endraw %}" $(podman inspect --format "{% raw %}{{ .InfraContainerID }}{% endraw %}" www) > {{ services_containers_directory }}/pod-www/pidfile'
ExecStartPost=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-www ExecStartPost=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-www
ExecStartPost=/usr/bin/sudo /usr/sbin/ifup veth-www ExecStartPost=/usr/bin/sudo /usr/sbin/ifup veth-www
ExecStop=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-www ExecStop=/usr/bin/sudo /usr/sbin/ifdown --ignore-errors veth-www