Skip to content

Commit 1c400bc

Browse files
authored
dumb ass fixes logs he broke. (#16)
2 parents 7d43348 + 297e1b7 commit 1c400bc

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

Yolk/entrypoint.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -493,13 +493,11 @@ run_sbox() {
493493
log_info "Command: wine \"${SBOX_SERVER_EXE}\" ${redacted_args[*]}"
494494

495495
cd "${SBOX_INSTALL_DIR}"
496-
env "${launch_env[@]}" wine "${SBOX_SERVER_EXE}" "${args[@]}" &
497-
SERVER_PID=$!
498-
499-
if ! wait "${SERVER_PID}"; then
500-
log_error "S&Box server process exited unexpectedly (pid=${SERVER_PID}, exit=$?)"
501-
return 1
502-
fi
496+
# Run server in foreground so Pterodactyl can track the main process.
497+
# Tee stdout to `${LOG_FILE}` and stderr to `${ERROR_LOG}` while preserving console output.
498+
exec env "${launch_env[@]}" wine "${SBOX_SERVER_EXE}" "${args[@]}" \
499+
> >(tee -a "${LOG_FILE}") \
500+
2> >(tee -a "${ERROR_LOG}" >&2)
503501
}
504502

505503
# ============================================================================

0 commit comments

Comments
 (0)