From bb3bbb64f815bfff0fb0a0d753c347ced0f81b99 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 30 Jul 2023 01:07:02 -0500 Subject: [PATCH 1/4] Include busybox (for crond) Signed-off-by: Eric Nemchik --- Dockerfile | 1 + Dockerfile.aarch64 | 1 + 2 files changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index 23b997e..9615f91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -68,6 +68,7 @@ ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \ RUN \ echo "**** install base packages ****" && \ dnf -y --setopt=install_weak_deps=False --best install \ + busybox \ ca-certificates \ coreutils \ curl \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index c2e2b3b..cfef702 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -68,6 +68,7 @@ ENV PS1="$(whoami)@$(hostname):$(pwd)\\$ " \ RUN \ echo "**** install base packages ****" && \ dnf -y --setopt=install_weak_deps=False --best install \ + busybox \ ca-certificates \ coreutils \ curl \ From bc60449337e0de350ae765c763baa248529cb98d Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 30 Jul 2023 09:48:32 -0500 Subject: [PATCH 2/4] Fix perms Signed-off-by: Eric Nemchik --- root/etc/s6-overlay/s6-rc.d/init-adduser/run | 64 ++++++++--------- .../s6-overlay/s6-rc.d/init-custom-files/run | 44 ++++++------ root/etc/s6-overlay/s6-rc.d/init-envfile/run | 34 +++++----- .../s6-overlay/s6-rc.d/init-migrations/run | 68 +++++++++---------- 4 files changed, 105 insertions(+), 105 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-adduser/run b/root/etc/s6-overlay/s6-rc.d/init-adduser/run index a03a3e9..d873b6c 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-adduser/run +++ b/root/etc/s6-overlay/s6-rc.d/init-adduser/run @@ -1,32 +1,32 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -PUID=${PUID:-911} -PGID=${PGID:-911} - -groupmod -o -g "$PGID" abc -usermod -o -u "$PUID" abc - -cat /etc/s6-overlay/s6-rc.d/init-adduser/branding - -if [[ -f /donate.txt ]]; then - echo ' -To support the app dev(s) visit:' - cat /donate.txt -fi -echo ' -To support LSIO projects visit: -https://www.linuxserver.io/donate/ - -─────────────────────────────────────── -GID/UID -───────────────────────────────────────' -echo " -User UID: $(id -u abc) -User GID: $(id -g abc) -─────────────────────────────────────── -" - -lsiown abc:abc /app -lsiown abc:abc /config -lsiown abc:abc /defaults +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +PUID=${PUID:-911} +PGID=${PGID:-911} + +groupmod -o -g "$PGID" abc +usermod -o -u "$PUID" abc + +cat /etc/s6-overlay/s6-rc.d/init-adduser/branding + +if [[ -f /donate.txt ]]; then + echo ' +To support the app dev(s) visit:' + cat /donate.txt +fi +echo ' +To support LSIO projects visit: +https://www.linuxserver.io/donate/ + +─────────────────────────────────────── +GID/UID +───────────────────────────────────────' +echo " +User UID: $(id -u abc) +User GID: $(id -g abc) +─────────────────────────────────────── +" + +lsiown abc:abc /app +lsiown abc:abc /config +lsiown abc:abc /defaults diff --git a/root/etc/s6-overlay/s6-rc.d/init-custom-files/run b/root/etc/s6-overlay/s6-rc.d/init-custom-files/run index 3d8a17e..dcdf5a4 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-custom-files/run +++ b/root/etc/s6-overlay/s6-rc.d/init-custom-files/run @@ -1,22 +1,22 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -# Directories -SCRIPTS_DIR="/custom-cont-init.d" - -# Make sure custom init directory exists and has files in it -if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then - echo "[custom-init] Files found, executing" - for SCRIPT in "${SCRIPTS_DIR}"/*; do - NAME="$(basename "${SCRIPT}")" - if [[ -f "${SCRIPT}" ]]; then - echo "[custom-init] ${NAME}: executing..." - /bin/bash "${SCRIPT}" - echo "[custom-init] ${NAME}: exited $?" - elif [[ ! -f "${SCRIPT}" ]]; then - echo "[custom-init] ${NAME}: is not a file" - fi - done -else - echo "[custom-init] No custom files found, skipping..." -fi +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# Directories +SCRIPTS_DIR="/custom-cont-init.d" + +# Make sure custom init directory exists and has files in it +if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then + echo "[custom-init] Files found, executing" + for SCRIPT in "${SCRIPTS_DIR}"/*; do + NAME="$(basename "${SCRIPT}")" + if [[ -f "${SCRIPT}" ]]; then + echo "[custom-init] ${NAME}: executing..." + /bin/bash "${SCRIPT}" + echo "[custom-init] ${NAME}: exited $?" + elif [[ ! -f "${SCRIPT}" ]]; then + echo "[custom-init] ${NAME}: is not a file" + fi + done +else + echo "[custom-init] No custom files found, skipping..." +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-envfile/run b/root/etc/s6-overlay/s6-rc.d/init-envfile/run index 5dbf809..608d352 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-envfile/run +++ b/root/etc/s6-overlay/s6-rc.d/init-envfile/run @@ -1,17 +1,17 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then - for FILENAME in /run/s6/container_environment/*; do - if [[ "${FILENAME##*/}" == "FILE__"* ]]; then - SECRETFILE=$(cat "${FILENAME}") - if [[ -f ${SECRETFILE} ]]; then - FILESTRIP=${FILENAME//FILE__/} - cat "${SECRETFILE}" >"${FILESTRIP}" - echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}" - else - echo "[env-init] cannot find secret in ${FILENAME##*/}" - fi - fi - done -fi +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then + for FILENAME in /run/s6/container_environment/*; do + if [[ "${FILENAME##*/}" == "FILE__"* ]]; then + SECRETFILE=$(cat "${FILENAME}") + if [[ -f ${SECRETFILE} ]]; then + FILESTRIP=${FILENAME//FILE__/} + cat "${SECRETFILE}" >"${FILESTRIP}" + echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}" + else + echo "[env-init] cannot find secret in ${FILENAME##*/}" + fi + fi + done +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-migrations/run b/root/etc/s6-overlay/s6-rc.d/init-migrations/run index ff0874b..0a4d08a 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-migrations/run +++ b/root/etc/s6-overlay/s6-rc.d/init-migrations/run @@ -1,34 +1,34 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -MIGRATIONS_DIR="/migrations" -MIGRATIONS_HISTORY="/config/.migrations" - -echo "[migrations] started" - -if [[ ! -d ${MIGRATIONS_DIR} ]]; then - echo "[migrations] no migrations found" - exit -fi - -for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do - NAME="$(basename "${MIGRATION}")" - if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then - echo "[migrations] ${NAME}: skipped" - continue - fi - echo "[migrations] ${NAME}: executing..." - chmod +x "${MIGRATION}" - EXIT_CODE=$( - /bin/bash "${MIGRATION}" - echo $? - ) - if [[ ${EXIT_CODE} -ne 0 ]]; then - echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" - exit "${EXIT_CODE}" - fi - echo "${NAME}" >>${MIGRATIONS_HISTORY} - echo "[migrations] ${NAME}: succeeded" -done - -echo "[migrations] done" +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +MIGRATIONS_DIR="/migrations" +MIGRATIONS_HISTORY="/config/.migrations" + +echo "[migrations] started" + +if [[ ! -d ${MIGRATIONS_DIR} ]]; then + echo "[migrations] no migrations found" + exit +fi + +for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do + NAME="$(basename "${MIGRATION}")" + if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then + echo "[migrations] ${NAME}: skipped" + continue + fi + echo "[migrations] ${NAME}: executing..." + chmod +x "${MIGRATION}" + EXIT_CODE=$( + /bin/bash "${MIGRATION}" + echo $? + ) + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" + exit "${EXIT_CODE}" + fi + echo "${NAME}" >>${MIGRATIONS_HISTORY} + echo "[migrations] ${NAME}: succeeded" +done + +echo "[migrations] done" From 746674cf2387bd406cd7ad55fab95a1986f67d91 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Sun, 30 Jul 2023 10:29:01 -0500 Subject: [PATCH 3/4] Fix line endings Signed-off-by: Eric Nemchik --- root/etc/s6-overlay/s6-rc.d/init-adduser/run | 64 ++++++++--------- .../s6-overlay/s6-rc.d/init-custom-files/run | 44 ++++++------ root/etc/s6-overlay/s6-rc.d/init-envfile/run | 34 +++++----- .../s6-overlay/s6-rc.d/init-migrations/run | 68 +++++++++---------- 4 files changed, 105 insertions(+), 105 deletions(-) diff --git a/root/etc/s6-overlay/s6-rc.d/init-adduser/run b/root/etc/s6-overlay/s6-rc.d/init-adduser/run index d873b6c..a03a3e9 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-adduser/run +++ b/root/etc/s6-overlay/s6-rc.d/init-adduser/run @@ -1,32 +1,32 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -PUID=${PUID:-911} -PGID=${PGID:-911} - -groupmod -o -g "$PGID" abc -usermod -o -u "$PUID" abc - -cat /etc/s6-overlay/s6-rc.d/init-adduser/branding - -if [[ -f /donate.txt ]]; then - echo ' -To support the app dev(s) visit:' - cat /donate.txt -fi -echo ' -To support LSIO projects visit: -https://www.linuxserver.io/donate/ - -─────────────────────────────────────── -GID/UID -───────────────────────────────────────' -echo " -User UID: $(id -u abc) -User GID: $(id -g abc) -─────────────────────────────────────── -" - -lsiown abc:abc /app -lsiown abc:abc /config -lsiown abc:abc /defaults +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +PUID=${PUID:-911} +PGID=${PGID:-911} + +groupmod -o -g "$PGID" abc +usermod -o -u "$PUID" abc + +cat /etc/s6-overlay/s6-rc.d/init-adduser/branding + +if [[ -f /donate.txt ]]; then + echo ' +To support the app dev(s) visit:' + cat /donate.txt +fi +echo ' +To support LSIO projects visit: +https://www.linuxserver.io/donate/ + +─────────────────────────────────────── +GID/UID +───────────────────────────────────────' +echo " +User UID: $(id -u abc) +User GID: $(id -g abc) +─────────────────────────────────────── +" + +lsiown abc:abc /app +lsiown abc:abc /config +lsiown abc:abc /defaults diff --git a/root/etc/s6-overlay/s6-rc.d/init-custom-files/run b/root/etc/s6-overlay/s6-rc.d/init-custom-files/run index dcdf5a4..3d8a17e 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-custom-files/run +++ b/root/etc/s6-overlay/s6-rc.d/init-custom-files/run @@ -1,22 +1,22 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -# Directories -SCRIPTS_DIR="/custom-cont-init.d" - -# Make sure custom init directory exists and has files in it -if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then - echo "[custom-init] Files found, executing" - for SCRIPT in "${SCRIPTS_DIR}"/*; do - NAME="$(basename "${SCRIPT}")" - if [[ -f "${SCRIPT}" ]]; then - echo "[custom-init] ${NAME}: executing..." - /bin/bash "${SCRIPT}" - echo "[custom-init] ${NAME}: exited $?" - elif [[ ! -f "${SCRIPT}" ]]; then - echo "[custom-init] ${NAME}: is not a file" - fi - done -else - echo "[custom-init] No custom files found, skipping..." -fi +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +# Directories +SCRIPTS_DIR="/custom-cont-init.d" + +# Make sure custom init directory exists and has files in it +if [[ -e "${SCRIPTS_DIR}" ]] && [[ -n "$(/bin/ls -A ${SCRIPTS_DIR} 2>/dev/null)" ]]; then + echo "[custom-init] Files found, executing" + for SCRIPT in "${SCRIPTS_DIR}"/*; do + NAME="$(basename "${SCRIPT}")" + if [[ -f "${SCRIPT}" ]]; then + echo "[custom-init] ${NAME}: executing..." + /bin/bash "${SCRIPT}" + echo "[custom-init] ${NAME}: exited $?" + elif [[ ! -f "${SCRIPT}" ]]; then + echo "[custom-init] ${NAME}: is not a file" + fi + done +else + echo "[custom-init] No custom files found, skipping..." +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-envfile/run b/root/etc/s6-overlay/s6-rc.d/init-envfile/run index 608d352..5dbf809 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-envfile/run +++ b/root/etc/s6-overlay/s6-rc.d/init-envfile/run @@ -1,17 +1,17 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then - for FILENAME in /run/s6/container_environment/*; do - if [[ "${FILENAME##*/}" == "FILE__"* ]]; then - SECRETFILE=$(cat "${FILENAME}") - if [[ -f ${SECRETFILE} ]]; then - FILESTRIP=${FILENAME//FILE__/} - cat "${SECRETFILE}" >"${FILESTRIP}" - echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}" - else - echo "[env-init] cannot find secret in ${FILENAME##*/}" - fi - fi - done -fi +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +if find /run/s6/container_environment/*"FILE__"* -maxdepth 1 > /dev/null 2>&1; then + for FILENAME in /run/s6/container_environment/*; do + if [[ "${FILENAME##*/}" == "FILE__"* ]]; then + SECRETFILE=$(cat "${FILENAME}") + if [[ -f ${SECRETFILE} ]]; then + FILESTRIP=${FILENAME//FILE__/} + cat "${SECRETFILE}" >"${FILESTRIP}" + echo "[env-init] ${FILESTRIP##*/} set from ${FILENAME##*/}" + else + echo "[env-init] cannot find secret in ${FILENAME##*/}" + fi + fi + done +fi diff --git a/root/etc/s6-overlay/s6-rc.d/init-migrations/run b/root/etc/s6-overlay/s6-rc.d/init-migrations/run index 0a4d08a..ff0874b 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-migrations/run +++ b/root/etc/s6-overlay/s6-rc.d/init-migrations/run @@ -1,34 +1,34 @@ -#!/usr/bin/with-contenv bash -# shellcheck shell=bash - -MIGRATIONS_DIR="/migrations" -MIGRATIONS_HISTORY="/config/.migrations" - -echo "[migrations] started" - -if [[ ! -d ${MIGRATIONS_DIR} ]]; then - echo "[migrations] no migrations found" - exit -fi - -for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do - NAME="$(basename "${MIGRATION}")" - if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then - echo "[migrations] ${NAME}: skipped" - continue - fi - echo "[migrations] ${NAME}: executing..." - chmod +x "${MIGRATION}" - EXIT_CODE=$( - /bin/bash "${MIGRATION}" - echo $? - ) - if [[ ${EXIT_CODE} -ne 0 ]]; then - echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" - exit "${EXIT_CODE}" - fi - echo "${NAME}" >>${MIGRATIONS_HISTORY} - echo "[migrations] ${NAME}: succeeded" -done - -echo "[migrations] done" +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +MIGRATIONS_DIR="/migrations" +MIGRATIONS_HISTORY="/config/.migrations" + +echo "[migrations] started" + +if [[ ! -d ${MIGRATIONS_DIR} ]]; then + echo "[migrations] no migrations found" + exit +fi + +for MIGRATION in $(find ${MIGRATIONS_DIR}/* | sort -n); do + NAME="$(basename "${MIGRATION}")" + if [[ -f ${MIGRATIONS_HISTORY} ]] && grep -Fxq "${NAME}" ${MIGRATIONS_HISTORY}; then + echo "[migrations] ${NAME}: skipped" + continue + fi + echo "[migrations] ${NAME}: executing..." + chmod +x "${MIGRATION}" + EXIT_CODE=$( + /bin/bash "${MIGRATION}" + echo $? + ) + if [[ ${EXIT_CODE} -ne 0 ]]; then + echo "[migrations] ${NAME}: failed with exit code ${EXIT_CODE}, contact support" + exit "${EXIT_CODE}" + fi + echo "${NAME}" >>${MIGRATIONS_HISTORY} + echo "[migrations] ${NAME}: succeeded" +done + +echo "[migrations] done" From a0b0c97c18e3cf453787b8041ed47886cafd2918 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Fri, 18 Aug 2023 23:06:32 -0500 Subject: [PATCH 4/4] cron in base Signed-off-by: Eric Nemchik --- .../dependencies.d/init-os-end | 0 .../s6-rc.d/init-crontab-config/run | 26 +++++++++++++++++++ .../s6-rc.d/init-crontab-config/type | 1 + .../s6-overlay/s6-rc.d/init-crontab-config/up | 1 + .../svc-cron/dependencies.d/init-services | 0 root/etc/s6-overlay/s6-rc.d/svc-cron/run | 15 +++++++++++ root/etc/s6-overlay/s6-rc.d/svc-cron/type | 1 + .../s6-rc.d/user/contents.d/svc-cron | 0 8 files changed, 44 insertions(+) create mode 100644 root/etc/s6-overlay/s6-rc.d/init-crontab-config/dependencies.d/init-os-end create mode 100755 root/etc/s6-overlay/s6-rc.d/init-crontab-config/run create mode 100644 root/etc/s6-overlay/s6-rc.d/init-crontab-config/type create mode 100644 root/etc/s6-overlay/s6-rc.d/init-crontab-config/up create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services create mode 100755 root/etc/s6-overlay/s6-rc.d/svc-cron/run create mode 100644 root/etc/s6-overlay/s6-rc.d/svc-cron/type create mode 100644 root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron diff --git a/root/etc/s6-overlay/s6-rc.d/init-crontab-config/dependencies.d/init-os-end b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/dependencies.d/init-os-end new file mode 100644 index 0000000..e69de29 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 new file mode 100755 index 0000000..6eee9a6 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/run @@ -0,0 +1,26 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +for cron_user in abc root; do + if [[ -f "/defaults/crontabs/${cron_user}" ]]; then + # make folders + mkdir -p \ + /config/crontabs + + # if crontabs do not exist in config + if [[ ! -f "/config/crontabs/${cron_user}" ]]; then + # copy crontab from system + if crontab -l -u "${cron_user}" >/dev/null; then + crontab -l -u "${cron_user}" >"/config/crontabs/${cron_user}" + fi + + # if crontabs still do not exist in config (were not copied from system) + # copy crontab from image defaults (using -n, do not overwrite an existing file) + cp -n "/defaults/crontabs/${cron_user}" /config/crontabs/ + fi + + # set permissions and import user crontabs + lsiown "${cron_user}":"${cron_user}" "/config/crontabs/${cron_user}" + crontab -u "${cron_user}" "/config/crontabs/${cron_user}" + fi +done diff --git a/root/etc/s6-overlay/s6-rc.d/init-crontab-config/type b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/type new file mode 100644 index 0000000..bdd22a1 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/type @@ -0,0 +1 @@ +oneshot diff --git a/root/etc/s6-overlay/s6-rc.d/init-crontab-config/up b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/up new file mode 100644 index 0000000..d354111 --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/init-crontab-config/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/init-crontab-config/run diff --git a/root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services b/root/etc/s6-overlay/s6-rc.d/svc-cron/dependencies.d/init-services new file mode 100644 index 0000000..e69de29 diff --git a/root/etc/s6-overlay/s6-rc.d/svc-cron/run b/root/etc/s6-overlay/s6-rc.d/svc-cron/run new file mode 100755 index 0000000..e8d71bf --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-cron/run @@ -0,0 +1,15 @@ +#!/usr/bin/with-contenv bash +# shellcheck shell=bash + +if builtin command -v crontab >/dev/null && [[ -n "$(crontab -l -u abc)" || -n "$(crontab -l -u root)" ]]; then + if builtin command -v busybox >/dev/null && [[ $(busybox) =~ [[:space:]](crond)([,]|$) ]]; then + exec busybox crond -f -S -l 5 + elif [[ -f /usr/bin/apt ]] && [[ -f /usr/sbin/cron ]]; then + exec /usr/sbin/cron -f -L 5 + else + echo "**** cron not found ****" + sleep infinity + fi +else + sleep infinity +fi diff --git a/root/etc/s6-overlay/s6-rc.d/svc-cron/type b/root/etc/s6-overlay/s6-rc.d/svc-cron/type new file mode 100644 index 0000000..5883cff --- /dev/null +++ b/root/etc/s6-overlay/s6-rc.d/svc-cron/type @@ -0,0 +1 @@ +longrun diff --git a/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron b/root/etc/s6-overlay/s6-rc.d/user/contents.d/svc-cron new file mode 100644 index 0000000..e69de29