From ba011900fb17933e198a8cc4ceb23e73bb49f9e8 Mon Sep 17 00:00:00 2001 From: mammo0 Date: Wed, 2 Dec 2020 12:58:19 +0100 Subject: [PATCH] web: prevent s6 from restarting cron if it shouldn't be run --- web/rootfs/etc/services.d/cron/run | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/web/rootfs/etc/services.d/cron/run b/web/rootfs/etc/services.d/cron/run index 636376b..d08f5f2 100755 --- a/web/rootfs/etc/services.d/cron/run +++ b/web/rootfs/etc/services.d/cron/run @@ -1,7 +1,10 @@ #!/usr/bin/with-contenv bash -if [[ $DISABLE_HTTPS -ne 1 ]]; then - if [[ $ENABLE_LETSENCRYPT -eq 1 ]]; then - exec cron -f - fi +if [[ $DISABLE_HTTPS -ne 1 ]] && \ + [[ $ENABLE_LETSENCRYPT -eq 1 ]]; then + exec cron -f +else + # if cron should not be started, + # prevent s6 from restarting this script again and again + s6-svc -O /var/run/s6/services/cron fi