🗃️ 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 for init in "$init_dir"/*.sh; do
if [ -f "$init" ]; then if [ -f "$init" ]; then
name="$(basename "$init")" name="$(basename "$init")"
sleep 10 && (exec "$init" &) && sleep 10 || false sleep 10 && sh -c "$init" && sleep 20 || false
initStatus=$(($? + initStatus)) initStatus=$(($? + initStatus))
echo "" echo ""
sleep 20
fi fi
done done
fi fi

View File

@ -364,7 +364,7 @@ __run_start_script() {
export cmd_exec="$cmd $args" export cmd_exec="$cmd $args"
message="Starting service: $name $args $message" message="Starting service: $name $args $message"
fi 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" [ -f "$START_SCRIPT" ] && chmod 755 -Rf "$START_SCRIPT"
[ -n "$su_exec" ] && echo "using $su_exec" [ -n "$su_exec" ] && echo "using $su_exec"
echo "$message" echo "$message"

View File

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