File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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# ============================================================================
You can’t perform that action at this time.
0 commit comments