[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian GNU/Linux Lenny server automatically reboot



Csanyi Pal wrote:
I have Debian GNU/Linux Lenny system as a server machine.
I run on it Apache2 webserver, Moodle, etc..

I notice that that it did reboot sometimes automatically.
Why could this happen? How can I inspect the cause of this event?
Understanding Linux crashes is a royal pain in the rear.

You have several options:

1. attach a serial console, configure your kernel to send console messages to it - somewhat of a pain, but when the kernel panics, some things ONLY go to the console (like a stack backtrace) -- there's a serial console howto on tldp.org that's a good start -- note that you'll need a console that saves stuff (e.g., a PC running a terminal program) -- for my servers, I purchased a rather nice box from Lantronix that turns a serial port into something you can ssh into via the net (server - serial port - Lantronix serial-to-ethernet-box - the net - ssh terminal program)

note: getting this all to work gets a little tricky, be prepared for a night in the server room, and be sure to have a rescue disk - getting the right incantations into /boot/grub/menu.lst can be tricky (moreso in my case, as I'm running Xen, which adds another level of complexity and configuration to the boot process)

you can set your machine to reboot, or not (see 2., below) - either way, you'll capture something on the serial terminal

2. set your machine to NOT reboot on crash -- that way a crash will leave you at a point where you might be able to nose around system state with a debugger (note: you'll need an attached console, preferably a serial terminal for this)

take a look in /etc/sysctl.conf for lines like
kernel.panic = 20
kernel.panic_on_oops = 1

or nose around in /proc/sys/kernel (do a google on /proc/sys/kernel for details)

see http://www.pc-freak.net/blog/how-to-automatically-reboot-restart-debian-gnu-lenny-linux-on-kernel-panic-some-general-cpu-overload-or-system-crash-2/ for some good background on how this all works

3. install a kernel that supports crash dumps and a crash dump utility - note that this is a bit of a pain in Linux, less so in BSD and Solaris based systems - with this approach you can set your machine to save a crash dump, then reboot - you can analyze the dump at your leisure -- sort of important if people depend on your server being up

Linux does NOT make crash analysis easy.

Miles Fidelman

--
In theory, there is no difference between theory and practice.
In<fnord>  practice, there is.   .... Yogi Berra



Reply to: