From b89cd71d1a3a058c40669f018b94b6b4c81dd740 Mon Sep 17 00:00:00 2001 From: Stephane de Labrusse Date: Tue, 30 Apr 2024 10:20:37 +0200 Subject: [PATCH] Update import-email-to-piler.service to fix sync2pilerdone file check --- imageroot/actions/configure-module/91import-email | 4 ---- imageroot/systemd/user/import-email-to-piler.service | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/imageroot/actions/configure-module/91import-email b/imageroot/actions/configure-module/91import-email index f9d222f..dbb9d42 100755 --- a/imageroot/actions/configure-module/91import-email +++ b/imageroot/actions/configure-module/91import-email @@ -6,8 +6,4 @@ # # This script is used to start the import-email-to-piler.service -if [[ -f 'sync2pilerdone' ]]; then - echo "## sync2pilerdone file is found, mail already migrated, exiting" - exit 0 -fi systemctl --user start --no-block import-email-to-piler.service diff --git a/imageroot/systemd/user/import-email-to-piler.service b/imageroot/systemd/user/import-email-to-piler.service index 60e3160..a012eae 100644 --- a/imageroot/systemd/user/import-email-to-piler.service +++ b/imageroot/systemd/user/import-email-to-piler.service @@ -3,9 +3,10 @@ # SPDX-License-Identifier: GPL-3.0-or-later # [Unit] -Description= import emails to piler +Description=Import emails to Piler +ConditionPathExists=!%S/state/sync2pilerdone [Service] ExecStart=/usr/local/bin/runagent import-emails -ExecStart=/usr/bin/touch sync2pilerdone +ExecStart=/usr/bin/touch %S/state/sync2pilerdone Type=oneshot