feat: use bash fork instead of tmux for multiple jobs

This commit is contained in:
Price Hiller 2023-01-15 15:01:39 -06:00
parent 9ca4b62c30
commit 94f4f81deb
2 changed files with 8 additions and 13 deletions

View File

@ -103,8 +103,7 @@ RUN <<__EOR__
apt-get update
apt-get install -y --no-install-suggests --no-install-recommends \
yarn \
nodejs \
tmux=3.1c-1+deb11u1
nodejs
rm -rf /var/lib/apt/lists/* /root/prepare-node14-yarn.bash

View File

@ -30,19 +30,15 @@ main() {
done < "${SQUAD_SERVER_DIR}/SquadGame/ServerConfig/Rcon.cfg" > "rcon.temp" && mv "rcon.temp" "${SQUAD_SERVER_DIR}/SquadGame/ServerConfig/Rcon.cfg"
printf "Starting the Squad Server....\n"
su "${USER}" << __EOC__
tmux new-session -d -s "Squad-Server" \
"${SQUAD_SERVER_DIR}/SquadGameServer.sh" \
Port="${GAMEPORT}" \
QueryPort="${QUERYPORT}" \
FIXEDMAXTICKRATE="${FIXEDMAXTICKRATE}" \
FIXEDMAXPLAYERS="${FIXEDMAXPLAYERS}" &&
printf "Started the Squad Server\n"
su "${USER}" - "${SQUAD_SERVER_DIR}/SquadGameServer.sh" \
Port="${GAMEPORT}" \
QueryPort="${QUERYPORT}" \
FIXEDMAXTICKRATE="${FIXEDMAXTICKRATE}" \
FIXEDMAXPLAYERS="${FIXEDMAXPLAYERS}" && exit "${?}" &
printf "Starting SquadJS...\n"
sleep 5
node "${USER_HOME}/SquadJS/index.js"
su "${USER}" - /usr/bin/node "${SQUADJS_DIR}/index.js" &
wait
__EOC__
}