From 7b51bb57f86d6a36d781f15c5199d1fbf3b178dc Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 30 Mar 2025 08:59:41 +0200 Subject: [PATCH] bundles/docker-immich: only start auto-album-share when postgresql is actually running --- bundles/docker-immich/metadata.py | 3 +++ bundles/systemd-timers/files/template.service | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/bundles/docker-immich/metadata.py b/bundles/docker-immich/metadata.py index 288b7f1..3952922 100644 --- a/bundles/docker-immich/metadata.py +++ b/bundles/docker-immich/metadata.py @@ -83,6 +83,9 @@ def auto_album_share(metadata): 'command': '/usr/local/bin/immich-auto-album-share.py', 'environment': metadata.get('docker-engine/containers/immich/environment'), 'when': 'minutely', + 'requisite': { + 'docker-immich-postgresql.service', + }, }, }, }, diff --git a/bundles/systemd-timers/files/template.service b/bundles/systemd-timers/files/template.service index 09c3080..271b756 100644 --- a/bundles/systemd-timers/files/template.service +++ b/bundles/systemd-timers/files/template.service @@ -7,8 +7,11 @@ [Unit] Description=Service for Timer ${timer} After=network.target -% if config.get('requires', ''): -Requires=${config['requires']} +% if config.get('requires', set()): +Requires=${' '.join(sorted(config['requires']))} +% endif +% if config.get('requisite', set()): +Requisite=${' '.join(sorted(config['requisite']))} % endif [Service]