LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-31-2014, 03:29 AM   #1
Dathaeus
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Rep: Reputation: Disabled
Auto-restart with kernel panic


I read this thing

Add the following to /etc/sysctl.conf:
kernel.panic=20

Is this for is there is a GPU failure for whatever reason, it will auto-restart the whole rig? Until I figure out whats wrong, I need to at least have it auto-restart when something fails, because restarting does fix it, and rarely needs a hard reboot.

The only thing is, if this is all the code I need, I did it but it doesnt seem to be working. I actually put a 7 in there like this

kernel.panic=7

but that shouldnt matter right? And I put it in the last line of the file at the very bottom, with a line break after the last #:

Code:
#

kernel.panic=7
(Not sure how anal Linux is but the space of lack of on either side of the "=" couldnt possibly matter right?)

And then what is the easiest way to create a "soft" panic to test if its working and not wait for one?

Thanks.

Last edited by Dathaeus; 01-31-2014 at 03:42 AM.
 
Old 01-31-2014, 09:31 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,110
Blog Entries: 10

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
The spacing matters, use no spaces.

There is also a "panic on oops" flag which you can, and should set. These are "modifiable" in sysctl.conf, but they can be set in your kernel boot line. I don't know the sysctl.conf variations as well. Review the kernel parameters documentation, search for the term panic and review the notes describing what the system should do for each flag.

Kernel Parameters.
 
Old 01-31-2014, 03:53 PM   #3
Dathaeus
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
The spacing matters, use no spaces.

There is also a "panic on oops" flag which you can, and should set. These are "modifiable" in sysctl.conf, but they can be set in your kernel boot line. I don't know the sysctl.conf variations as well. Review the kernel parameters documentation, search for the term panic and review the notes describing what the system should do for each flag.

Kernel Parameters.
I've put it in with no space, still nothing.

Your latter info, I have no idea what thats about... I used to use DOS and BASIC but I hardly know anything in Linux.
 
Old 01-31-2014, 04:38 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,110
Blog Entries: 10

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
I'd change the command line parameters adding:
Code:
oops=panic panic=7 unknown_nmi_panic
 
Old 01-31-2014, 05:38 PM   #5
Dathaeus
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
I'd change the command line parameters adding:
Code:
oops=panic panic=7 unknown_nmi_panic
So add that instead of my original kernel.panic=7 line? Also does placement matter in the sysctl.conf file, bottom, top, etc?
 
Old 02-01-2014, 06:41 PM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,110
Blog Entries: 10

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
Quote:
Originally Posted by Dathaeus View Post
So add that instead of my original kernel.panic=7 line? Also does placement matter in the sysctl.conf file, bottom, top, etc?
No. Put that in your kernel boot line. Nothing to do with sysctl.conf
 
Old 02-02-2014, 10:45 AM   #7
Dathaeus
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
No. Put that in your kernel boot line. Nothing to do with sysctl.conf
Sorry, I am really not a linux user... the kernel boot line is a file or u mean just type it in the prompt in the root terminal? I know these are idiot questions but even when I do a search, I just get more confused and I dont wanna just start typing commands in wherever.

Thanks for your patience.
 
Old 02-03-2014, 08:18 AM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,110
Blog Entries: 10

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
Quote:
Originally Posted by Dathaeus View Post
Sorry, I am really not a linux user...
Well, this is pretty technical stuff you're asking about here. At this point I'd recommend you do some research about how Linux boots before you proceed. The answers have been given; however if you're unfamiliar with how the kernel boots and how to modify your boot parameters, then a quick answer here isn't the best option. If you're really determined, I recommend you read about the bootloader, grub; and learn how it manages boot parameters.

Mind you; installing and using Linux is fine and sounds like you've done that. At this point you're trying to tune how the kernel operates, but looking for a singular answer without fully understanding the scope of the topic. Therefore my best recommendation is to either leave it alone or learn about grub so that when you do attempt boot option changes, you understand what you're doing and how to deal with it if you happen to make a mistake.
 
Old 02-03-2014, 10:13 AM   #9
Dathaeus
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rtmistler View Post
Well, this is pretty technical stuff you're asking about here. At this point I'd recommend you do some research about how Linux boots before you proceed. The answers have been given; however if you're unfamiliar with how the kernel boots and how to modify your boot parameters, then a quick answer here isn't the best option. If you're really determined, I recommend you read about the bootloader, grub; and learn how it manages boot parameters.

Mind you; installing and using Linux is fine and sounds like you've done that. At this point you're trying to tune how the kernel operates, but looking for a singular answer without fully understanding the scope of the topic. Therefore my best recommendation is to either leave it alone or learn about grub so that when you do attempt boot option changes, you understand what you're doing and how to deal with it if you happen to make a mistake.
I understand what u r saying... let me elaborate on why I need to do this. I have a BAMT rig setup for mining. It runs on Debian, but is stripped for one purpose only. However, when there is a hardware failure (99.9% GPU), it crashes and then it stop the whole process. I am troubleshooting and trying to find out whats really going on about this, but its not easy and not quick. Meanwhile, I lose $$$ every second the machine is down.

So to me (and suggested by others in similar situations who know more linux than me), a "decent" bandaid is:

1. Set up an auto-reboot whenever there is a hardware failure (kernel panic)
or
2. Set up an auto-reboot every 10 (whatever #) minutes so it preempts any failure

I know these solutions are not very professional, but its better than losing $$$ all day every day while I have invested time and money in the rig and setup. I was hoping I can just input a few lines in a file or two in the system that will help me achieve this until I find a permanent solution. If I had all the time in the world, I would love to learn linux properly and thoroughly. Unfortunately this project is is less than 10% of all the other stuff I need to do to sustain myself.

I hope that clears things up a bit, thanks.
 
Old 02-03-2014, 07:16 PM   #10
Dathaeus
LQ Newbie
 
Registered: Jan 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Someone told me to do this and it actually worked... but I set the timer for way too fast, how do I edit? I tried crontab -e and -i and I cant seem to find it... always something......

Code:
echo "*/10 * * * * root coldreboot" >> /etc/crontab
 
Old 02-04-2014, 09:14 AM   #11
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 4,110
Blog Entries: 10

Rep: Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525Reputation: 1525
Quote:
Originally Posted by Dathaeus View Post
Someone told me to do this and it actually worked... but I set the timer for way too fast, how do I edit? I tried crontab -e and -i and I cant seem to find it... always something......

Code:
echo "*/10 * * * * root coldreboot" >> /etc/crontab
I would ask the person who advised you to put a coldreboot entry into your cron table for further advice on how to correct or change it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to tell what causes kernel panic at restart/shutdown rjo98 Linux - Server 3 02-09-2013 01:59 PM
[SOLVED] cooker kernel panic after --auto-update crashed Unable to mount root fs on unknown-bl Emmanuel_uk Mandriva 6 04-26-2012 07:43 AM
Kernel Panic on Shutdown or Restart stlyz3 Linux - Server 1 10-07-2008 02:47 AM
Auto-login and auto-restart... TankerKevo Red Hat 2 10-04-2003 08:52 AM
kernel automatically restart if there is a panic kernelpanicguy Linux - Software 3 07-29-2003 10:06 PM


All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration