🗃️ Committing everything that changed 🗃️

rootfs/usr/local/etc/docker/functions/entrypoint.sh
rootfs/usr/local/etc/docker/init.d/00-tftpd.sh
rootfs/usr/local/etc/docker/init.d/zz-nginx.sh
This commit is contained in:
casjay 2024-07-14 18:37:48 -04:00
parent 3f6cb9ee2c
commit 6318dc754e
Signed by untrusted user who does not match committer: jason
GPG Key ID: 1AB309F42A764145
3 changed files with 14 additions and 15 deletions

View File

@ -501,10 +501,9 @@ __start_init_scripts() {
for init in "$init_dir"/*.sh; do
if [ -f "$init" ]; then
name="$(basename "$init")"
sleep 10 && (exec "$init" &) && sleep 10 || false
sleep 10 && sh -c "$init" && sleep 20 || false
initStatus=$(($? + initStatus))
echo ""
sleep 20
fi
done
fi

View File

@ -364,7 +364,7 @@ __run_start_script() {
export cmd_exec="$cmd $args"
message="Starting service: $name $args $message"
fi
[ -f "$START_SCRIPT" ] && printf '#!/usr/bin/env sh\n# %s\n%s\n' "$message" "$cmd_exec" >"$START_SCRIPT"
[ -f "$START_SCRIPT" ] && printf '#!/usr/bin/env sh\n# %s\n%s\n' "$message" "$cmd_exec &" >"$START_SCRIPT"
[ -f "$START_SCRIPT" ] && chmod 755 -Rf "$START_SCRIPT"
[ -n "$su_exec" ] && echo "using $su_exec"
echo "$message"

View File

@ -412,7 +412,7 @@ __run_start_script() {
local sysname="${SERVER_NAME:-${FULL_DOMAIN_NAME:-$HOSTNAME}}" # set hostname
[ -f "$CONF_DIR/$SERVICE_NAME.exec_cmd.sh" ] && . "$CONF_DIR/$SERVICE_NAME.exec_cmd.sh"
if [ -z "$cmd" ]; then
__post_execute 2>"/dev/stderr" |& tee -p -a "$LOG_DIR/init.txt" &>/dev/null
__post_execute 2>"/dev/stderr" | tee -p -a "$LOG_DIR/init.txt" >/dev/null
retVal=$?
echo "Initializing $SCRIPT_NAME has completed"
exit $retVal
@ -420,7 +420,7 @@ __run_start_script() {
# ensure the command exists
if [ ! -x "$cmd" ]; then
echo "$name is not a valid executable"
exit 2
return 2
fi
# set working directories
[ -z "$home" ] && home="${workdir:-/tmp/docker}"
@ -435,7 +435,7 @@ __run_start_script() {
# check and exit if already running
if __proc_check "$name" || __proc_check "$cmd"; then
echo "$name is already running" >&2
exit 0
return 0
else
# cd to dir
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -453,22 +453,22 @@ __run_start_script() {
export cmd_exec="$cmd $args"
message="Starting service: $name $args $message"
fi
[ -f "$START_SCRIPT" ] || printf '#!/usr/bin/env sh
# %s
%s
' "$message" "$cmd_exec" >"$START_SCRIPT"
[ -x "$START_SCRIPT" ] || chmod 755 -Rf "$START_SCRIPT"
[ -f "$START_SCRIPT" ] && printf '#!/usr/bin/env sh\n# %s\n%s\n' "$message" "$cmd_exec &" >"$START_SCRIPT"
[ -f "$START_SCRIPT" ] && chmod 755 -Rf "$START_SCRIPT"
[ -n "$su_exec" ] && echo "using $su_exec"
echo "$message"
su_cmd touch "$SERVICE_PID_FILE"
__post_execute |& tee -p -a "$LOG_DIR/init.txt" &>/dev/null &
if [ "$RESET_ENV" = "yes" ]; then
su_cmd env -i HOME="$home" LC_CTYPE="$lc_type" PATH="$path" HOSTNAME="$sysname" USER="${SERVICE_USER:-$RUNAS_USER}" $extra_env sh -c "$START_SCRIPT" ||
eval env -i HOME="$home" LC_CTYPE="$lc_type" PATH="$path" HOSTNAME="$sysname" USER="${SERVICE_USER:-$RUNAS_USER}" $extra_env sh -c "$START_SCRIPT" ||
return 10
env_command="$(eval echo "env -i HOME=\"$home\" LC_CTYPE=\"$lc_type\" PATH=\"$path\" HOSTNAME=\"$sysname\" USER=\"${SERVICE_USER:-$RUNAS_USER}\" $extra_env")"
echo "$env_command"
su_cmd $env_command sh -c "$START_SCRIPT" || eval $env_command sh -c "$START_SCRIPT"
runExitCode=$?
else
su_cmd "$START_SCRIPT" || eval "$START_SCRIPT" || return 10
su_cmd "$START_SCRIPT" || eval "$START_SCRIPT"
runExitCode=$?
fi
return $runExitCode
fi
fi
}