reboot cron job

hesseh

Dabbler
Joined
May 5, 2013
Messages
15
on previous freenas I ran a reboot cron job: once a month it executed a .sh file with the command /sbin/reboot ... never had any problems but now on TrueNas 12 system will not successfully execute command and will hang without complete reboot... what would be the best way to automatically reboot system periodically?
 

hesseh

Dabbler
Joined
May 5, 2013
Messages
15
You are right: system under normal circumstances should not be rebooted and in the future I plan not to but still I wonder why the old command does not work anymore...
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You shouldn't be, and shouldn't need to periodically reboot your FreeNAS system.
Totally agree.

In case somebody can come up with a reason why it does make sense to do that:
>>>WARNING! the following command immediately initiates a reboot with no delay nor further confirmation requested <<<
midclt call system.reboot
 

Vincentca

Cadet
Joined
Feb 26, 2021
Messages
5
The ability to have a cron to reboot the system would be good for me.
For some reason, anytime my internet has a hiccup, Truenas decides it's not going to reconnect to the network. I'm not always able to get to the server, so it would be nice to have a cron set up to reboot it in those cases where I'm unable to do it manually.
 

Arwen

MVP
Joined
May 17, 2014
Messages
3,611
Another thing is to have a cronjob, (or daemon script), monitor something, like ping the router, and if it fails for a set period of times, (pings, 10 seconds apart, 12 in a row fail), then reboot. Basically you are trying to detect the failure condition and work around it.

Their are external devices that can do the same. Some UPSes can do this. And some network aware A.C. switches can ping connected devices, and if one fails, deprive it of A.C. power, then restore power. Forcing a crash & boot. A kind of external watchdog.
 

Vincentca

Cadet
Joined
Feb 26, 2021
Messages
5
Another thing is to have a cronjob, (or daemon script), monitor something, like ping the router, and if it fails for a set period of times, (pings, 10 seconds apart, 12 in a row fail), then reboot. Basically you are trying to detect the failure condition and work around it.

Their are external devices that can do the same. Some UPSes can do this. And some network aware A.C. switches can ping connected devices, and if one fails, deprive it of A.C. power, then restore power. Forcing a crash & boot. A kind of external watchdog.
I really like this idea.
I'm also trying 'netwait' to see if that fixes my issue first. But I'll probably try your solution after.
 
Top