
我製作了一個 shell 腳本來運行我喜歡的遊戲的伺服器。我需要在關閉膩子時運行伺服器。現在 Putty 是控制台,但我需要它在關閉程式時不關閉。
startServer.sh:
~/server_1/srcds_run -game garrysmod +maxplayers 32 +map gm_bigcity
我需要它來運行守護程式中的所有內容。
答案1
試試這個 :
nohup $HOME/server_1/srcds_run -game garrysmod +maxplayers 32 +map gm_bigcity & > logfile 2>&1
如果您想追蹤螢幕上出現的內容,請使用日誌檔案。如果你不在乎,請將其替換為 /dev/null
man nohup
欲了解更多信息