LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Auto-restart with kernel panic (https://www.linuxquestions.org/questions/linux-newbie-8/auto-restart-with-kernel-panic-4175493227/)

Dathaeus 01-31-2014 02:29 AM

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.

rtmistler 01-31-2014 08:31 AM

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.

Dathaeus 01-31-2014 02:53 PM

Quote:

Originally Posted by rtmistler (Post 5108666)
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.

rtmistler 01-31-2014 03:38 PM

I'd change the command line parameters adding:
Code:

oops=panic panic=7 unknown_nmi_panic

Dathaeus 01-31-2014 04:38 PM

Quote:

Originally Posted by rtmistler (Post 5108934)
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?

rtmistler 02-01-2014 05:41 PM

Quote:

Originally Posted by Dathaeus (Post 5108958)
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

Dathaeus 02-02-2014 09:45 AM

Quote:

Originally Posted by rtmistler (Post 5109427)
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.

rtmistler 02-03-2014 07:18 AM

Quote:

Originally Posted by Dathaeus (Post 5109684)
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.

Dathaeus 02-03-2014 09:13 AM

Quote:

Originally Posted by rtmistler (Post 5110310)
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.

Dathaeus 02-03-2014 06:16 PM

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

rtmistler 02-04-2014 08:14 AM

Quote:

Originally Posted by Dathaeus (Post 5110829)
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.


All times are GMT -5. The time now is 11:17 AM.