Results 1 to 9 of 9
-
07-15-2005, 05:42 PM #1Web Hosting Master
- Join Date
- Oct 2001
- Posts
- 1,319
Linux Tip: Auto Reboot after Kernel Panic
I thought I'd share this little known trick that I discovered while reading through parts of the linux kernel...
Linux has the ability to automatically reboot after a kernel panic, it goes as follows
Assuming you use lilo, edit the /etc/lilo.conf file
under your current (and future) boot images, add the line:
append="panic=15"
Then reload lilo by running /sbin/lilo
And next time you have a kernel panic (heaven forbid!) it should reboot after 15 seconds!
Enjoy.Avi B
-
07-15-2005, 06:15 PM #2Retired Moderator
- Join Date
- Jul 2002
- Location
- Kuwait
- Posts
- 10,620
Thanks
Moved To Technical & Security Tutorials Forum
-
07-15-2005, 09:08 PM #3Junior Guru Wannabe
- Join Date
- Jun 2005
- Posts
- 43
Great tip!
Thank's!
-
07-16-2005, 02:36 PM #4Junior Guru
- Join Date
- Dec 2004
- Posts
- 224
Excellent! Thanks for that..
What about grub??
-
07-16-2005, 02:57 PM #5Junior Guru Wannabe
- Join Date
- Jun 2005
- Posts
- 43
Originally posted by SmartTux
Excellent! Thanks for that..
What about grub??
kernel /vmlinuz-2.6.11 root=/dev/md0 ro panic=15
-
07-16-2005, 09:25 PM #6Web Hosting Master
- Join Date
- Oct 2001
- Posts
- 1,319
PS - you can also do the following:
echo 60 > /proc/sys/kernel/panic
that will have your server reboot 60 seconds after a panic. That must be done after each reboot, so you can add that line in /etc/rc.d/rc.local
This is an alternate way if you don't want to mess with GRUB or lilo.Avi B
-
07-17-2005, 11:06 PM #7Web Hosting Guru
- Join Date
- Mar 2005
- Posts
- 297
Originally posted by heymar
Sample:
kernel /vmlinuz-2.6.11 root=/dev/md0 ro panic=15
OT: Congrats on 1000 posts, MaB!
-
08-25-2005, 04:15 PM #8Web Hosting Master
- Join Date
- Dec 2002
- Location
- The Shadows
- Posts
- 2,925
It needs to mount the drives read-only before it mounts it write... Well, need isn't the correct word, "likes" is probably a better word.
Mounting read-only prevents any programs starting from writing to the disk before it is ready.Dan Sheppard ~ Freelance whatever
-
08-26-2005, 08:02 PM #9Aspiring Evangelist
- Join Date
- Nov 2002
- Location
- Los Angeles, CA
- Posts
- 415
Nice and simple. I like that