Posts: 5
Threads: 1
Joined: Feb 2010
Reputation:
0
Ok so I am running srcds server on UNIX/FreeBSD system. When i try to restart the server or when it restarts on it's own after crash it always starts on different port that is +1 bigger then the first. For example if I start the server on 27015 and the server crashes and restarts, it will bind to 27016, the next crash it binds to 27017 and so on. What is going on here? Why it doesn't want to bind to original port after crash/restart?
Thank you.
Posts: 1,587
Threads: 15
Joined: Jun 2005
Reputation:
0
my initial guess is the initial process isn't completely dieing and is still bound to the port. Try a netstat -lpnute | grep ":27015" to see whats bound to that port. I'm not too familiar with freebsd and I know some of their commands are a bit different than other linux systems so there may be a little variation in that command.
Posts: 5
Threads: 1
Joined: Feb 2010
Reputation:
0
OK so that is the problem. After crash the port is stil binded and the server tries on +1 port. WHY?
How can I force the server to close the port after crash? I've tried 5 crashes and all ports stayed binded :S untill I kill the process manually. How can I fix this? Thank you very much.
Posts: 1,587
Threads: 15
Joined: Jun 2005
Reputation:
0
That means the srcds process isn't really crashing. Its still getting hung. You could try to write a script to automate killing that process. Just something like:
kill -9 `netstat -lpnute | grep ":27015" | awk '{print $8}' | cut -d/ -f1`
should do the trick. At least if your netstat is formatted the same as is it is on the centos machine I just tested that on. You may need to change the number on the awk command to represent the column for the pid/program.
Posts: 1,587
Threads: 15
Joined: Jun 2005
Reputation:
0
what do you have restarting the server when it crashes? You may need to modify that.
Posts: 1,587
Threads: 15
Joined: Jun 2005
Reputation:
0
How does your server restart automatically after it crashes? Typically you have something that's monitoring the server so when it crashes the process is automatically restarted.
Posts: 1,655
Threads: 38
Joined: Apr 2008
Reputation:
20
SRCDS doesn't restart on its own. Is it trying to autoupdate? Please post your startup line so we can better help you.