USB script executed during sysinit, ntp_timer setup

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2
Author Message
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Sat May 14, 2022 14:32    Post subject: Re: USB script executed during sysinit... how many times? Reply with quote
egc wrote:
kernel-panic69 wrote:
Udhcpc gets WAN IP which DNSMasq and NTP rely on to work... for IPv4...


That is why I wrote:
Quote:
Maybe my example is not exactly true but you get the meaning.

Yeah, my ADH-OCD overlooked that Razz Rolling Eyes Cool Mr. Green
mwchang wrote:
It would be great if DD-WRT's Busybox could enable the "flock" command. Then we could use file locking to avoid multiple instances of a certain process.

Most any busybox-included applets are strictly at the hands of firmware size constraints. Priority is always DD-WRT base code, as far as I know of.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
Sponsor
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Tue May 17, 2022 11:42    Post subject: Reply with quote
kernel-panic69 wrote:
SFE recycles every NTP sync; there are probably others that do as well. This is why I only sync NTP once per 24 hours. Less log spam Wink Cool


How to do that? I don't see a place to set the timer in Basic Setup -> Time Service ...

Update:

Oh well, I found a related but old post, and I was in the thread, and the-joker as well. Not sure whether the suggested patch was accepted. Smile

DD-WRT Forum :: View topic - [PATCH] Increase NTP update period
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=318131&sid=c9f895a8e8633e56e9d2555e15041878

Nevertheless, sfe was still restarted multiple times during sysinit(?):
Code:
> grep sfe /var/log/messages

Jan  1 08:00:12 RT-N18U-HST kern.info kernel: [    0.942494] PCI: bus0: Fast back to back transfers disabled
Jan  1 08:00:12 RT-N18U-HST kern.info kernel: [    0.942946] PCI: bus1: Fast back to back transfers disabled
Jan  1 08:00:14 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully stopped
Jan  1 08:00:19 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started
Jan  1 08:00:22 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started
Jan  1 08:00:27 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully stopped
Jan  1 08:00:27 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started
Jan  1 08:00:28 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully stopped
Jan  1 08:00:30 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started
Jan  1 08:00:31 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started
May 17 19:51:07 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully stopped
May 17 19:51:07 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started
May 17 19:51:08 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully stopped
May 17 19:51:09 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started
May 17 19:51:11 RT-N18U-HST user.info : [sfe] : shortcut forwarding engine successfully started



_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue May 17, 2022 13:12    Post subject: Reply with quote
@mwchang, that thread the last post https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1247182#1247182 explain how to set the NTP interval, I have it set to 1 week

ntp_timer=432000 which doesn't matter if you reboot or upgrade and reboot it will sync once and then a week only later. But Yea, I flash a new dev build sometimes twice or 3 times a day to test UI fixes. Othewise, I dont care if I loose 1 second or two in a week if even that much.

It would be nice to know what the offset is when NTP syncs, but its not reported and Im not confident enough to be able to submit a patch to that end.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Tue May 17, 2022 15:22    Post subject: Reply with quote
the-joker wrote:
@mwchang, that thread the last post https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1247182#1247182 explain how to set the NTP interval, I have it set to 1 week

ntp_timer=432000 which doesn't matter if you reboot or upgrade and reboot it will sync once and then a week only ....

Too bad there is no WEB UI option to input that value. I knew it's hard to deal with Javacript. Smile


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Tue May 17, 2022 15:42    Post subject: Reply with quote
Such a setting is 10 minutes work, that is not the problem.

But I am not sure what actually the problem is with updating the time every hour.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue May 17, 2022 15:50    Post subject: Reply with quote
It triggers other things to recycle and people do not know how to handle the syslog messages. There really is no need to sync more than once per 24 hours IMHO.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue May 17, 2022 18:24    Post subject: Reply with quote
egc wrote:
Such a setting is 10 minutes work, that is not the problem.

But I am not sure what actually the problem is with updating the time every hour.

10 minutes to set a nvram variable, is this index finger only typing and searching for the next letter type thing? If so, half hour at least to an hour being generous. Very Happy Laughing and my dd-wrt passwords are 40 characters long. So imagine that, takes me 3 hours to log in on a bad day when my index finger is tired. Wink

I think the problem with NTP as standard interval causes other services that are dependent on any time to restart also, and too much log noise.

Several threads on that issue, I'm not looking for any to link them here, so I apologize for that, but they exist.

That said... It would be nice to have a UI interval timer bit and also a log entry to report the offset when NTP syncs. Im curious to see how much time Im losing in a week.

My C skills being crap (not at any level dd-wrt needs) and using my index finger only, I would have that patch ready next century.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Tue May 17, 2022 18:52    Post subject: Reply with quote
LoL, no 10 minutes to make it, see screenshot Smile


Naamloos.png
 Description:
 Filesize:  11.18 KB
 Viewed:  1265 Time(s)

Naamloos.png



_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14125
Location: Texas, USA

PostPosted: Tue May 17, 2022 19:01    Post subject: Reply with quote
Maybe we can finally close these tickets with a little luck.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Tue May 17, 2022 19:34    Post subject: Reply with quote
egc wrote:
LoL, no 10 minutes to make it, see screenshot Smile


Yey, you're my hero...

To be the fairest heroest hero of them all, then the sync offset log massage too Wink or was that there also? anywho...

Thanks

the index finger typist

Joker

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Wed May 18, 2022 7:11    Post subject: Reply with quote
I am travelling the coming 4 weeks so have fun with it.

It is not tested and I am still not convinced about the necessity and usefulness.

I suggest you confer with BS about it, at least the work is done Smile



ntp_timer-option.zip
 Description:

Download
 Filename:  ntp_timer-option.zip
 Filesize:  1.16 KB
 Downloaded:  34 Time(s)


_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Wed May 18, 2022 9:08    Post subject: Reply with quote
Well, have a nice time or try to enjoy yourself during your travels.

Re: usefulness;

UI option to manipulate ntp_timer: this is not hidden on most platforms from UI, personally Im against hidden knobs unless there are real risks associated with them, this one seems harmless enough and offers it to novice users who are afraid of a terminal.
Quite a few long time users weren't even aware of this (judging from their replies). terrible if you ask me.

Personally for me, I,m comfortable with how it is but wont kick it out of the bed.

Time Offset; To know how far behind your router is when using larger interval times and then one can decide if the interval vs offset is desired and so adjust things accordingly.

Without the offset time after the update one cant really make any determination or adjustments.

I will indeed pass it to BS. Thanks for being the fairest heroest of them all =)

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Thu May 19, 2022 14:29    Post subject: Reply with quote
So the ntp_timer thing has been merged and will be live on next public build after r48897

A small addition I did, adding the default value span + range on https://github.com/mirror/dd-wrt/pull/175/files?diff=unified&w=1

Looks good so far and works as intended.

Would be nice to add the ntp update offset on sync syslog logging so we can determine which interval works best vs the time lost during the current interval set.



Capture.PNG
 Description:
 Filesize:  10.29 KB
 Viewed:  1183 Time(s)

Capture.PNG



_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Thu May 19, 2022 18:50    Post subject: Reply with quote
so to let you guys know that https://svn.dd-wrt.com/changeset/48931 adds a offset syslog report, so now we can make a judgement based on the drift between the time set and the difference when taking in consideration the interval set.

Then the ntp interval can be set to a value that more appropriate to what the individual needs are.

Note that most routers as noted by BS, dont have a RTC, so this is a software clock and depending on routers load it may worsen the offset.

Use wisely and responsibly. BS recommends default 3600sec or 1 hour (so that scheduled tasks dont go awry aka cron dependent anything).

Obviously within his use case doesn't care about log spam or the constant related services restarting on each NTP sync or how that affects regular usage for real world users that dont want the constant interruptions in services due to constant service restarts.

So take all in consideration.

Should be documented in wiki somewhere NTP related.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Mon May 23, 2022 8:34    Post subject: Reply with quote
egc wrote:
Such a setting is 10 minutes work, that is not the problem.

But I am not sure what actually the problem is with updating the time every hour.

The option has been added in build 48954!

DD-WRT Forum :: View topic - [PATCH] Increase NTP update period
https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1263240#1263240

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
Goto page Previous  1, 2 Display posts from previous:    Page 2 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware 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 can attach files in this forum
You can download files in this forum