Serious Problem

LuxLux Join Date: 2002-11-17 Member: 9078Members
Hi

I am running freeBSD decitated server. It was running fine for about 2 years, never had any problems till yesterday

the server crashed cause there were to many turrtes or something, that is beside the point. From this I did what i normaly do: kill all the hlds pids that are running ns and then restart them. I type:
<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1--> ps -ax | grep ns  
  89  ??  Ss    10:49.69 sendmail: accepting connections (sendmail)
90465  ??  R    111:45.22 ./hlds -game ns +port 27016 +maxplayers 16 + map ns_eclipse +exec server.cfg
<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
then I type

<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1--> kill -9 90465  <!--c2--></td></tr></table><span class='postcolor'><!--ec2-->
this normaly works, but this time nothign happened. the process is R which means its in que i think. First I thought ok it must have auto rebooted or something and I couldnt kill it because I was not root, so I got the guy that has root and he couldnt kill it either! WTH is up with that?

Comments

  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    when you kill -9 it, does it keep the same PID?

    If you're running HLDS using the hlds_run script, it will automatically restart HLDS after you kill it. You'll have two processes, hlds_run and hlds. hlds will come back with a new PID each time you kill it.

    "ps -waux | grep hlds" output?
  • f3Rl3SSf3Rl3SS Join Date: 2003-01-28 Member: 12878Members
    edited March 2003
  • LuxLux Join Date: 2002-11-17 Member: 9078Members
    nope the pid does not change. I am unable to kill it, and the point of using kill -9 is so that it does not restart.
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    <!--QuoteBegin--Lux+Mar 5 2003, 07:47 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Lux @ Mar 5 2003, 07:47 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->nope the pid does not change. I am unable to kill it<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    If the process state is still "R" or "R+", and root is unable to kill -9 it, then something is seriously amiss. If the state is something other than that, report back. Otherwise, I'd try restarting the entire machine (yeah yeah, it's not windows, you shouldn't have to reboot, blah blah... <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->).

    Actually, before you do that, what's the output of<!--c1--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->sh -c 'kill -9 90465; echo $?'<!--c2--></td></tr></table><span class='postcolor'><!--ec2-->

    Just curious, what version of FreeBSD are you running? uname -a is sufficient, if you would. Obscure the hostname if you wish.

    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->and the point of using kill -9 is so that it does not restart.<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->
    hlds_run wraps around hlds. No matter how hlds dies (SIG TERM, segfault, etc), if hlds_run is configured to restart hlds (the default), it will. If you're running hlds_run, that is.
  • LuxLux Join Date: 2002-11-17 Member: 9078Members
    <!--QuoteBegin--verbose+Mar 5 2003, 10:12 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (verbose @ Mar 5 2003, 10:12 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
    If the process state is still "R" or "R+", and root is unable to kill -9 it, then something is seriously amiss. If the state is something other than that, report back. <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    Yea the root is unable to kill it :/

    <!--QuoteBegin--verbose+Mar 5 2003, 10:12 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (verbose @ Mar 5 2003, 10:12 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->
    Actually, before you do that, what's the output of 
    sh -c 'kill -9 90465; echo $?'

    Just curious, what version of FreeBSD are you running? uname -a is sufficient, if you would. Obscure the hostname if you wish.
    <!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    I am too newb to understand your linux jargon, after all I dont really know liunx just the basic commands to vi, kill and execute various server things. Other then that I have a very vauge idea of what is going on. I am not sure what sh -c means but that command dosnt return anything besides $. Version: FreeBSD nfo 4.6.2-RELEASE FreeBSD 4.6.2-RELEASE #0: Wed Oct 2 20:58:07 PDT 2002

    Any other ideas besides rebooting?
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    You need that whole command, single quotes and question mark

    sh -c 'kill -9 90465; echo $?'

    That's just executing your kill command use the basic sh shell (I don't know if you use tcsh/bash/etc, so I included that to guarantee my command will work), while the "echo $?" displays the exit code of the last command. It should be zero. If it's one, or something other than that, then kill itself encountered a problem with trying to send the signal to the process, which will help me narrow the problem down.

    It is possible that it's just the process accounting that's wrong, and hlds isn't actually running. See if something has a listener on port 27015:

    netstat -na | grep 27015

    If nothing shows up, then you should be able to start a new hlds, and ignore the old one. Although if possible, I'd still do a reboot. Beyond that, I don't have any new ideas at this point. Asking on the freebsd-questions mailing list would likely turn up some more ideas; lots of helpful and knowledgable folks there. <a href='http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/eresources.html#ERESOURCES-MAIL' target='_blank'>FreeBSD Mailing List information</a>

    The only time I've never been able to kill a process is one that's stuck in state "D" ('ps' man page even says "uninterruptible"). These are often caused by processess that are trying to use an NFS mounted filesystem that's disappeared. Bringing the appropriate NFS server and share back online unsticks the process, and allows things to continue normally.
  • LuxLux Join Date: 2002-11-17 Member: 9078Members
    edited March 2003
    sh -c 'kill -9 90465; echo $?'
    result: 0

    bash-2.05a$ netstat -na | grep 27016
    result: udp4 25792 0 *.27016 *.*

    thx for your help so far
  • verboseverbose Join Date: 2002-11-25 Member: 9968Members, Constellation
    Yep, sorry I'm out of ideas Lux. It appears genuinely stuck, and I don't know what to do about that besides reboot.
Sign In or Register to comment.