OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: nVIceman on April 19, 2022, 05:19:35 PM

Title: Auto Reboot After Kernel Panic/Etc
Post by: nVIceman on April 19, 2022, 05:19:35 PM
I'm having an issue with a install that has been repeatedly having issues that prevents the internet from working, but it's fixed simply by rebooting it. I'm still trying to work out what's going on with it, but is there a way to set it to Auto reboot after it has such an issue so it at least doesn't keep the internet down until somebody could manually reboot it?
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: franco on April 20, 2022, 08:23:04 AM
After a kernel panic it already automatically reboots (unless something is severely broken or not coming back up properly). Some hardware may not reboot due to broken power supply and simply turn off. What exact issue are you seeing when the internet stops working?


Cheers,
Franco
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: nVIceman on April 22, 2022, 01:05:27 AM
I am not sure why it loses connectivity. It was happening every 15 minutes or so a couple of times, then lasted 2 days, not happened again, but didn't reoccur yet. I don't see any report in the main page, nothing obvious where I have looked yet. Is there a good spot to pull a log from that may contain this data?

This device is not where I am at physically, so I wanted to at least make it reboot when this happens, which it doesn't, but a reboot fixes it every time.
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: nVIceman on April 24, 2022, 03:38:21 AM
Still happening, still don't know why, but in the meantime, how can I auto reboot OPNsense after failed ping? I can setup ping to Internet domain and have it reboot when failing enough times to help prevent the Internet from staying down until it is manually rebooted.

Edit:
Found some script that hopefully works to try to require WAN, then reboot if needed. Time will tell.
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: nVIceman on April 24, 2022, 06:40:07 PM
So I know the script I was using from the thread link below at least as the first ping as I could see it in the firewall log, but when the internet went down overnight, it never rebooted I could should have. I don't know if something has changed where the script no longer completely functions correctly.

https://forum.opnsense.org/index.php?topic=10924.0
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: nVIceman on May 02, 2022, 05:16:10 AM
Just bumping this, OPNsense not rebooting when losing connectivity. Script linked above doesn't work to completion apparently. Regardless of this current issue, would love to have working script for when something like this happens.
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: Grossartig on May 02, 2022, 05:19:38 PM
I had a quick look at the script (I am by no means a shell expert), but the last command /usr/local/etc/rc.reboot doesn't exist on my OPNsense 22.1.6 box anymore. Try replacing that command with /usr/sbin/reboot.
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: nVIceman on May 02, 2022, 09:49:57 PM
Thanks, fails after 1 minute exactly from start of script when Internet is down, script exits with error 127.
Title: Re: Auto Reboot After Kernel Panic/Etc
Post by: nVIceman on May 03, 2022, 06:14:56 PM
OPNsense seems to be locking up, not sure if that is what is causing Internet loss or even Internet loss is causing some kind of havoc to OPNsense, but could explain why script wouldn't work anyways or why an auto reboot via cron didn't have overnight when Internet had gone down prior.