17.02.2014, 06:42
First install GDB - gnu debugger on your server.
Then create a runserver.sh file with these 3 lines:
Mark the file as executable and run the .sh file instead of samp03svr directly:
The server will run in GDB with a script that will generate EXCELLENT crash reports, you are encouraged to always use this method to run your server.
These crash reports will be greatly superior to anything else and will be of much more help when analyzing what happened when your server crashes and what caused it.
The script will generate last_crash.log and crash.log - crash.log contains a history of all crashes and last_crash contains the last crash report that happenes.
You can also add core dumps support by adding "-ex "generate-core-file"" before "-ex "set logging off"".
Core dumps can be a few-100 mb big but they allow you to do additional analysis of a crash by a skilled programmer after the crash had happened.
Then create a runserver.sh file with these 3 lines:
Код:
echo 0 | gdb -batch-silent -ex "run" -ex "set logging overwrite on" -ex "set logging file last_crash.log" -ex "set logging on" -ex "set pagination off" -ex "handle SIG33 pass nostop noprint" -ex "echo backtrace:\n" -ex "backtrace full" -ex "echo \n\nregisters:\n" -ex "info registers" -ex "echo \n\ncurrent instructions:\n" -ex "x/16i \$pc" -ex "echo \n\nthreads backtrace:\n" -ex "thread apply all backtrace" -ex "echo \n\nMemory map:\n" -ex "info files" -ex "set logging off" -ex "quit" samp03svr date >> crash.log cat last_crash.log >> crash.log
Код:
user@host:~/samp03$ ./runserver
These crash reports will be greatly superior to anything else and will be of much more help when analyzing what happened when your server crashes and what caused it.
The script will generate last_crash.log and crash.log - crash.log contains a history of all crashes and last_crash contains the last crash report that happenes.
You can also add core dumps support by adding "-ex "generate-core-file"" before "-ex "set logging off"".
Core dumps can be a few-100 mb big but they allow you to do additional analysis of a crash by a skilled programmer after the crash had happened.