(12-29-2009, 01:31 AM)_dp Wrote: Some addition to this:
If you start your commandline with an amp "&" at the end, it means that this application will remain active after pressing STRG+C or Closing the terminal. If you don't want that, i.e. to test new server configurations, don't use the &.
i usually list the processes by typing: "ps uwx" this shows only the running processes of the current user. i never heard of the -ef parameter, but of course they might work too
"kill #pid" is in most cases enough to shutdown a server, it means that the application will receive a term signal. by adding -9 to it, the application will get the kill signal. in most cases, you'll want to terminate your server with the normal "kill #pid" command and only use the -9 if the process doesn't respond at all. (happend only 2 times for me in ~3 years of gameserver administration)
//edit:
if your server keeps restarting, there might be the startscript still running. type ps uwx to find your startscript. until this startscript isn't terminated, the server will always be revived.
I think you can find all the start scripts with
ps -A | grep srcds_run
Running it on my server the results were:
17321 ? 00:00:08 srcds_run
18736 ? 00:00:16 srcds_run
25094 ? 00:00:07 srcds_run
10309 pts/2 00:00:00 srcds_run
13477 ? 00:00:08 srcds_run
4102 ? 00:00:05 srcds_run
23222 pts/0 00:00:00 srcds_run
25977 pts/6 00:00:00 srcds_run
19027 pts/10 00:00:00 srcds_run
though I had only 2 servers actually running.
I then used
kill -9 17321
then
kill -9 18736
and so on to kill every pid. Then I restarted my servers, making a note of the pid for each one so I would know which one I was killing in the future.
----------
Just tried
ps -C srcds_run
It works the same as
ps -A | grep srcds_run
but also shows a caption for the column, PID TTY TIME CMD
ps -ef shows all PIDS running on the server