-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically postpone automated reboots by deferable-reboot #1147
base: master
Are you sure you want to change the base?
Conversation
Tested and it works. |
Just increased a bit the deferring time (from 13 min to 30 min) in order to be sure that the network had time to re-establish the connection after a failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see inline comments
} | ||
|
||
unique_append \ | ||
"*/3 * * * * ((sleep $((RANDOM % 120)); if ping -c 10 -W 10 \$(uci -q get lime-autogen.system.deferable_reboot_ping_target) &> /dev/null; then awk '{print \$1 + 1800}' /proc/uptime > /tmp/deferable-reboot.defer ; fi )&) "\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems a bit ugly and breakage prone to add a command so complex in the crontab, do you mind to create a script that does that, and call it from the crontab ? Ultimately I could even merge it like this but I do prefer if a more elegant solution is proposed.
As explained in #1023, deferable-reboot was developed in two pieces, the main one on this repository and a very useful piece in the LibreRouterOS repository.
Without the second piece, the routers would just reboot every 27 hours, annoying.
With the second piece, the routers are checking the internet connectivity every 3 minutes (by means of a ping to a known IP on the internet) and the reboot is deferred by 13 minutes if the ping is successful.
With this PR, the second piece is also included in the deferable-reboot package in this repository.
The IP to be pinged has been de-hardcoded and moved to the LibreMesh configuration files in the system section.
The chosen IP is one of the ones being used as DNS:
lime-packages/packages/lime-docs/files/www/docs/lime-example.txt
Lines 48 to 49 in 6642f37
I am testing in these days, please do not merge yet.