[SOLVED] Fix for dd-wrt's chronic cron issues

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload
Author Message
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 74

PostPosted: Fri Sep 27, 2019 5:06    Post subject: [SOLVED] Fix for dd-wrt's chronic cron issues Reply with quote
Here's a fix to this file for dd-wrt's chronic cron issues. This should help with a number of bugs such as 6744, 1955, 6683, 6688 and others.

One of the comments in defect 1955 states: "Not reproducable, works fine here and the code for it is correct". A quick look at database.c will show that "*system*" is repeatedly used as "unique key" for multiple distinct records. The fix simply makes the unique key actually unique by appending the filename to it and everything works.

Cron is actually always running fine every minute, but with the database unique keys being invalid, when changes occur to cron table files, anything can happen. To reproduce, touching /tmp/crontab and touching/editing/adding/removing files in /etc/cron.d/ should result in erratic cron behavior quick enough.

Fix it any way you like, but please don't sweep it under the now 14 year old rug.


Last edited by yoyoma2 on Wed Oct 09, 2019 12:54; edited 1 time in total
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 3953
Location: Netherlands

PostPosted: Sat Sep 28, 2019 10:54    Post subject: Reply with quote
@yoyoma2, like I already posted, your patch looked valid to me and I contacted BS and he has already patched the source code. see: https://svn.dd-wrt.com/changeset/41189

So in the next build it should be good.

If you can test the next build and report your findings (you can PM me or report in the original thread) that would be great.

Thanks for your work, much appreciated

_________________
Routers:Netgear R7800, Netgear R6400v1, Netgear R6400v2, Linksys EA6900 (XvortexCFE), Linksys E2000 (converted WRT320N), WRT54GS v1.
Install guide Linksys EA6900: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=291230
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
giles02134
DD-WRT User


Joined: 25 Feb 2007
Posts: 117

PostPosted: Sat Sep 28, 2019 11:48    Post subject: Reply with quote
That's great news! I'll wait for reports on the effectiveness of the patch in the coming release, before I update my own installation.

Thanks to all for following this through.

_________________
Router: Linksys WRT1900ACSv2
Modem: Arris Surfboard SB6141
DD-WRT v3.0-r41218 std (10/1/19)
ISP: RCN
NAS: ReadyNas314
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 74

PostPosted: Sat Sep 28, 2019 14:49    Post subject: Reply with quote
Wow thats a quick turnaround!

Unfortunately I only have one router (Asus RT-AC56U: DD-WRT v3.0-r39960M kongac) with lots of stuff configured. To switch over to a BS build with minimal downtime I just ordered a cheap Netgear R6300v2 (almost same specs as RT-AC56U) from China but the sea shipping can take months. To be safe I wouldn't switch Kong->BS without a full reset.

I'm quite confident dd-wrt's cron reliability will greatly improve after 41189.

Thanks egc and BS for the quick reaction.
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 3953
Location: Netherlands

PostPosted: Sat Sep 28, 2019 15:33    Post subject: Reply with quote
yoyoma2 wrote:
Wow thats a quick turnaround!

Unfortunately I only have one router (Asus RT-AC56U: DD-WRT v3.0-r39960M kongac) with lots of stuff configured. To switch over to a BS build with minimal downtime I just ordered a cheap Netgear R6300v2 (almost same specs as RT-AC56U) from China but the sea shipping can take months. To be safe I wouldn't switch Kong->BS without a full reset.

I'm quite confident dd-wrt's cron reliability will greatly improve after 41189.

Thanks egc and BS for the quick reaction.



Thank you for your contribution greatly appreciated!
I agree about the full reset so lets hope the chinese postal service delivers quickly Smile

_________________
Routers:Netgear R7800, Netgear R6400v1, Netgear R6400v2, Linksys EA6900 (XvortexCFE), Linksys E2000 (converted WRT320N), WRT54GS v1.
Install guide Linksys EA6900: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=291230
OpenVPN Policy Based Routing guide: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=321686
Install guide R6400v2:http://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
OpenVPN Server Setup:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318795
Install guide R7800: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
giles02134
DD-WRT User


Joined: 25 Feb 2007
Posts: 117

PostPosted: Wed Oct 09, 2019 8:19    Post subject: Cron in R41218 Reply with quote
I did a firmware update yesterday (9-Oct) with Firefox 69.0.2 x64). The flash proceeded normally, and the router rebooted without a problem.

I can report that the cron issue has indeed been fixed. Before flashing, I removed all startup commands which referenced yoyoma2's cronwd.sh, and also removed the cronwd.sh cron job Administration->management->additional cron jobs. The router rebooted on its own at 3:00a.m. as specified in Administration->Keepalive.

Thanks to yoyoma2 for not only submitting a fix for the bug, but for the workaround he'd provided prior to the new release.

_________________
Router: Linksys WRT1900ACSv2
Modem: Arris Surfboard SB6141
DD-WRT v3.0-r41218 std (10/1/19)
ISP: RCN
NAS: ReadyNas314
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Contributions Upload All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum