Reboot Command Timing

Did I see a discussion about how to command a device reboot after 7200 seconds (i.e. 2 hours)? I thought I saw a pi command line fix that would do an auto re-boot.

vb77

… according to my clock.

A cron job should do the trick if you have access to the command line.

What’s the benefit of doing a reboot every few hours?

1 Like

My Pi and my Linux PC run continuos months in a row. I only rebooted them if a new installation required.

2 Likes

@SoNic67 and foxhunter: Because it’s fun? But seriously, my skyview maps is inaccessible after a time and the only way I can recover it is to reboot the device (or the router). It’s been running for months too, collecting data. I’m pretty sure I have a local wifi/router issue. It still receives messages and tracks a/c while the map is away.

Another thought is to find a sleep routine pi when the number of a/c drops below, say 5, during particuar (early morning) hours and then reawakens on the sixth track or ping. Pick a number, I’m just not facile enough with the software.

The implication was that you need to find the root of that instability. It might be even card corruption…

2 Likes

I would also check the root cause.

My device was also not accessible frequently. That’s a bit annoying over night where it needs until the next morning where i can power off and on again.

I then found out that the device was running perfectly all the time, but lost the network connection.

So i have now implemented a small script that pings my router. If not available, network interface is restarted. If nothing helps, the device reboots.

You say the map is not accessible. Can you still ping it and access it via SSH? Or is it completely dead?
Syslog might give you an idea.

There’s been some discussion about dhcpcd SEGFAULTING and not restarting.
But it doesn’t necessarily have to be the same issue.

This should reboot the Pi if it doesn’t have connectivity to the internet for 10 minutes.
pingfail · wiedehopf/adsb-scripts Wiki · GitHub

It won’t work if the entire Pi stops working.
It will work if just the network connectivity breaks down.

I am using this one, set in cron every five minutes. So far during the last issues the network reset made the job, only one time a complete reboot was required.

Oh, I’ve tried. I had to claim a few nodes from one location. My sandisk SD cards have been new and nothing less that 8gb storage. My data is transferring fine. Just can’t see skyview. I think I’ve nailed it down.

This sounds typical. Data isn’t corrupt. Console pings the device, etc.

thanks! Like I said my software skill is fortran iv. :crazy_face:

The pi works find. … a local issue. I wonder if I need to tinker with my router bandwidth.

if everything works fine except the map, is your webserver running?

@widehopf: I clear my cache all the time.

pi works fine

pretty sure my network breaks.

Yep. I think it’s pretty simple. Thanks though.

… and thanks for the link. I also used your pingfail.sh from github. It seems to have stabilized my browser and ui.

I’ll let it run a few days and try to report back.

vb77

Next time it happens and you reboot the Pi to recover, take a look at syslog for any clues as to what happened.

$ less /var/log/syslog

and

$ less /var/log/syslog.1

to view today’s and yesterday’s syslog files. Use Up, Down, PgUp, PgDn to jump around the entries. Use q to quit. Use /dhcpcd and /segv (forward slash followed by that text) to locate any lines showing evidence of dhcpcd misbehaving or crashing. Here’s an example:

Jan 19 21:39:06 piaware systemd[1]: dhcpcd.service: Main process exited, code=killed, status=11/SEGV

Depending on how long the Raspberry was running the syslog might be too large and uncomofrable for using less.

I am using the tail command together with some filtering. My initial start in that log is the time where the device got reconnected to my router.