diff --git a/rootfs/usr/local/etc/docker/init.d/00-named.sh b/rootfs/usr/local/etc/docker/init.d/00-named.sh index 7a30278..0c5a7f2 100755 --- a/rootfs/usr/local/etc/docker/init.d/00-named.sh +++ b/rootfs/usr/local/etc/docker/init.d/00-named.sh @@ -674,16 +674,16 @@ __fix_permissions "$SERVICE_USER" "$SERVICE_GROUP" # __run_pre_execute_checks 2>/dev/stderr | tee -a -p "/data/logs/entrypoint.log" "/data/logs/init.txt" || exit 20 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__run_start_script 2>>/dev/stderr | tee -p -a "/data/logs/entrypoint.log" && errorCode=0 || errorCode=10 +__run_start_script 2>>/dev/stderr | tee -p -a "/data/logs/entrypoint.log" +errorCode=$? if [ -n "$EXEC_CMD_BIN" ]; then if [ "$errorCode" -eq 0 ]; then SERVICE_EXIT_CODE=0 SERVICE_IS_RUNNING="yes" else - echo "Failed to execute: ${cmd_exec:-$(eval echo "$EXEC_CMD_BIN $EXEC_CMD_ARGS")}" | tee -p -a "/data/logs/entrypoint.log" "/data/logs/init.txt" SERVICE_EXIT_CODE=$errorCode - rm -Rf "$SERVICE_PID_FILE" - SERVICE_IS_RUNNING="no" + SERVICE_IS_RUNNING="${SERVICE_IS_RUNNING:-no}" + [ -s "$SERVICE_PID_FILE" ] || rm -Rf "$SERVICE_PID_FILE" fi SERVICE_EXIT_CODE=0 fi diff --git a/rootfs/usr/local/etc/docker/init.d/03-php-fpm.sh b/rootfs/usr/local/etc/docker/init.d/03-php-fpm.sh index 031b696..28904ef 100755 --- a/rootfs/usr/local/etc/docker/init.d/03-php-fpm.sh +++ b/rootfs/usr/local/etc/docker/init.d/03-php-fpm.sh @@ -574,16 +574,16 @@ __fix_permissions "$SERVICE_USER" "$SERVICE_GROUP" # __run_pre_execute_checks 2>/dev/stderr | tee -a -p "/data/logs/entrypoint.log" "/data/logs/init.txt" || return 20 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__run_start_script 2>>/dev/stderr | tee -p -a "/data/logs/entrypoint.log" && errorCode=0 || errorCode=10 +__run_start_script 2>>/dev/stderr | tee -p -a "/data/logs/entrypoint.log" +errorCode=$? if [ -n "$EXEC_CMD_BIN" ]; then if [ "$errorCode" -eq 0 ]; then SERVICE_EXIT_CODE=0 SERVICE_IS_RUNNING="yes" else - echo "Failed to execute: ${cmd_exec:-$(eval echo "$EXEC_CMD_BIN $EXEC_CMD_ARGS")}" | tee -p -a "/data/logs/entrypoint.log" "/data/logs/init.txt" SERVICE_EXIT_CODE=$errorCode - rm -Rf "$SERVICE_PID_FILE" - SERVICE_IS_RUNNING="no" + SERVICE_IS_RUNNING="${SERVICE_IS_RUNNING:-no}" + [ -s "$SERVICE_PID_FILE" ] || rm -Rf "$SERVICE_PID_FILE" fi SERVICE_EXIT_CODE=0 fi diff --git a/rootfs/usr/local/etc/docker/init.d/99-nginx.sh b/rootfs/usr/local/etc/docker/init.d/99-nginx.sh index 8dec12a..83a16f3 100755 --- a/rootfs/usr/local/etc/docker/init.d/99-nginx.sh +++ b/rootfs/usr/local/etc/docker/init.d/99-nginx.sh @@ -574,16 +574,16 @@ __fix_permissions "$SERVICE_USER" "$SERVICE_GROUP" # __run_pre_execute_checks 2>/dev/stderr | tee -a -p "/data/logs/entrypoint.log" "/data/logs/init.txt" || return 20 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -__run_start_script 2>>/dev/stderr | tee -p -a "/data/logs/entrypoint.log" && errorCode=0 || errorCode=10 +__run_start_script 2>>/dev/stderr | tee -p -a "/data/logs/entrypoint.log" +errorCode=$? if [ -n "$EXEC_CMD_BIN" ]; then if [ "$errorCode" -eq 0 ]; then SERVICE_EXIT_CODE=0 SERVICE_IS_RUNNING="yes" else - echo "Failed to execute: ${cmd_exec:-$(eval echo "$EXEC_CMD_BIN $EXEC_CMD_ARGS")}" | tee -p -a "/data/logs/entrypoint.log" "/data/logs/init.txt" SERVICE_EXIT_CODE=$errorCode - rm -Rf "$SERVICE_PID_FILE" - SERVICE_IS_RUNNING="no" + SERVICE_IS_RUNNING="${SERVICE_IS_RUNNING:-no}" + [ -s "$SERVICE_PID_FILE" ] || rm -Rf "$SERVICE_PID_FILE" fi SERVICE_EXIT_CODE=0 fi