From 78ab9cc5110b99703db8adf8664f449521004a27 Mon Sep 17 00:00:00 2001 From: thespad Date: Fri, 14 Jun 2024 14:02:03 +0100 Subject: [PATCH] Don't touch built-in crontabs in RO mode --- root/etc/s6-overlay/s6-rc.d/init-crontab-config/run | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run index 3b51d5a..45a4e88 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run @@ -2,9 +2,11 @@ # shellcheck shell=bash for cron_user in abc root; do - if [[ -f "/etc/crontabs/${cron_user}" ]]; then - lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}" - crontab -u "${cron_user}" "/etc/crontabs/${cron_user}" + if [[ -z ${LSIO_READ_ONLY_FS} ]] && [[ -z ${LSIO_NON_ROOT_USER} ]]; then + if [[ -f "/etc/crontabs/${cron_user}" ]]; then + lsiown "${cron_user}":"${cron_user}" "/etc/crontabs/${cron_user}" + crontab -u "${cron_user}" "/etc/crontabs/${cron_user}" + fi fi if [[ -f "/defaults/crontabs/${cron_user}" ]]; then