This question already has an answer here:

I have made a shell script to run a server for a game I like. I need the server to run when I close putty. Right now putty is the console, but I need it to not close when I close the program down.

startServer.sh: ~/server_1/srcds_run -game garrysmod +maxplayers 32 +map gm_bigcity I need it to run everything in there daemonized.

marked as duplicate by Jakuje, DopeGhoti, Jeff Schaller, Scott, vonbrand Feb 17 '16 at 0:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


try this :

nohup $HOME/server_1/srcds_run -game garrysmod +maxplayers 32 +map gm_bigcity & > logfile 2>&1

logfile is if you want to keep track of what is coming to the screen. if you don't care, replace it with /dev/null

man nohup for further info

  • Got it working thanks, I will forever be greatful – Xander Newlun Feb 16 '16 at 22:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.