From e890f470b66ba6bfc814b57f68ee7b0ef8498d08 Mon Sep 17 00:00:00 2001 From: TheSpad Date: Thu, 14 Jul 2022 22:20:10 +0100 Subject: [PATCH] Fix old path handling, touch deps --- root/docker-mods | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/root/docker-mods b/root/docker-mods index 881fb36..dcdcc4f 100755 --- a/root/docker-mods +++ b/root/docker-mods @@ -40,11 +40,11 @@ process_custom_services() { if { [ -z "$(/bin/ls -A ${SERVICES_DIR} 2>/dev/null)" ]; } && \ { [ -z "$(/bin/ls -A ${SERVICES_DIR_OLD} 2>/dev/null)" ]; }; then - echo "[custom-init] no custom files found, exiting..." + echo "[custom-init] no custom services found, skipping..." return fi - # Make sure custom init directory exists and has files in it + # Make sure custom service directory exists and has files in it if { [ -e "${SERVICES_DIR}" ] && [ -n "$(/bin/ls -A ${SERVICES_DIR} 2>/dev/null)" ]; }; then if [ -n "$(/bin/ls -A ${SERVICES_DIR} 2>/dev/null)" ]; then echo "[custom-init] service files found in ${SERVICES_DIR}" @@ -56,6 +56,8 @@ process_custom_services() { cp "${SERVICE}" /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/run chmod +x /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/run echo "longrun" > /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/type + touch /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/dependencies.d/init-mods + touch /etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/custom-svc-"${NAME}" echo "[custom-init] ${NAME}: copied" elif [ ! -f "${SERVICE}" ]; then echo "[custom-init] ${NAME}: is not a file" @@ -74,8 +76,9 @@ process_custom_services() { mkdir -p /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/ cp "${SERVICE}" /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/run chmod +x /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/run - echo "oneshot" > /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/type - echo "/etc/s6-overlay/s6-rc.d/custom-svc-${NAME}/run" > /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/up + echo "longrun" > /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/type + touch /etc/s6-overlay/s6-rc.d/custom-svc-"${NAME}"/dependencies.d/init-mods + touch /etc/s6-overlay/s6-rc.d/init-mods-end/dependencies.d/custom-svc-"${NAME}" echo "[custom-init] ${NAME}: copied" elif [ ! -f "${SERVICE}" ]; then echo "[custom-init] ${NAME}: is not a file"