How To Get "debug.log" File After Server Crash

FunkaFunka Join Date: 2002-11-03 Member: 5718Members
<div class="IPBDescription">Linux server operators only</div>
For other Linux operators who are not getting a "debug.log" file created on crash...

You've seen the message:
Add "-debug" to the ./hlds_run command line to generate a debug.log to help with solving this problem
but on our server (redhat 7.3/latest kernel 2.4.20), this "debug.log" file was not being created.

Adding the "-debug" flag when starting your hlds_run server will generate a coredump on crash. This has been mentioned elsewhere in these forums i believe. This coredump file will be placed in your hlds_l folder, and will be named either "core" or "core.PID" (where PID was the process ID). The hlds_run script, after a crash, looks for a file named simply "core" (with no extension) to determine whether it should create a "debug.log" file or not. Since our coredumps were not named "core", this is why the file was never created. So, i have attached instructions on how to modify your hlds_run script to quickly work around this. Keep in mind that while this has been working well for me, is definitely not the most pretty thing you'll see. i'm not expert in shell scripting, but it's enough to get you up and running.

Keep in mind you MUST REMOVE OR MOVE any existing "core.whatever" files into a separate folder FIRST before trying this, or at least rename them to something that does not start with the four letters c-o-r-e. You will see that the change to the hlds_run script simply makes it look for "core.*" instead of "core" on a restart, so this is why it is so important not to have any other pre-existing files in this hlds_l folder that are named like this.

Additionally, after the "debug.log" is created, it and the "core" file are renamed so as not to conflict with any files that will be created next time your server crashes. It is also highly recommended to always move these renamed "debug" and "core" files into a separate archiving directory as soon as possible.

The file attached is the just the modified portion of hlds_run script, as hastily crafted as it is, not the whole script. Please let me know if you have any comments or improvements to contribute.

Good luck!

Comments

  • VadakillVadakill The Almighty BSO Join Date: 2002-04-02 Member: 373Members, NS1 Playtester
    Funka, could you please re-post this in the Newbie HLDS thread pinned at the top? I think it's a handy thing to have/know and if it's pinned up on the top it won't get lost. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' valign='absmiddle' alt='smile.gif'><!--endemo-->
Sign In or Register to comment.