DST - Tonight (tomorrow morning)

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page Previous  1, 2, 3, 4
Author Message
ScooterComputer
DD-WRT Novice


Joined: 30 Oct 2008
Posts: 12

PostPosted: Tue Dec 13, 2011 20:20    Post subject: Re: On clocks and problems Reply with quote
Murrkf wrote:
It's not.


Even in the case of calculating key lifetime and nonesuch?
Sponsor
hvengel
DD-WRT Novice


Joined: 19 Dec 2011
Posts: 2

PostPosted: Mon Dec 19, 2011 18:09    Post subject: Reply with quote
I don't get what is going on. By default ntp should be continuously keeping the clock synced. In order for ntp to only run once it has to started with a command line arg that specifically makes it set the clock and exit. In other words for this to happen the default configuration for ntp has to be incorrect if the intent is to keep the clock synced with one or more external servers on an ongoing basis.

Also it appears that the configuration only allows for selecting one IP address for the ntp server. As a general rule using only one time server is a BAD idea since there is no way for ntp to detect if the server is keeping good time. Most ntp experts recommend using AT LEAST 4 servers since this will allow for two failures before ntp can no longer detect "bad tickers".

Related to this is it possible to hand configure the ntp server so that it behaves the way it should? IE. can I hand configure it using the /etc/ntp configuration file like I would on a normal Linux box? Is there a way to override the startup arguments?

Also is PPS and the kernel consumer configured in the kernel so that a local reference clock (like a GPS with a PPS signal) can be used?
Luniz2k1
DD-WRT Guru


Joined: 04 Oct 2007
Posts: 1261
Location: Ohio USA

PostPosted: Mon Dec 19, 2011 19:18    Post subject: Reply with quote
hvengel wrote:
I don't get what is going on. By default ntp should be continuously keeping the clock synced. In order for ntp to only run once it has to started with a command line arg that specifically makes it set the clock and exit. In other words for this to happen the default configuration for ntp has to be incorrect if the intent is to keep the clock synced with one or more external servers on an ongoing basis.

Also it appears that the configuration only allows for selecting one IP address for the ntp server. As a general rule using only one time server is a BAD idea since there is no way for ntp to detect if the server is keeping good time. Most ntp experts recommend using AT LEAST 4 servers since this will allow for two failures before ntp can no longer detect "bad tickers".

Related to this is it possible to hand configure the ntp server so that it behaves the way it should? IE. can I hand configure it using the /etc/ntp configuration file like I would on a normal Linux box? Is there a way to override the startup arguments?

Also is PPS and the kernel consumer configured in the kernel so that a local reference clock (like a GPS with a PPS signal) can be used?

If you take the time to browse the source code you will find:
http://svn.dd-wrt.com:8000/browser/src/router/services/services/services.c
Code:

void start_ntpc(void)
{
        char *servers = nvram_safe_get("ntp_server");

        if (!nvram_invmatch("ntpd_enable", "0"))
                return;

        if (strlen(servers)) {
                char *nas_argv[] =
                    { "ntpclient", "-h", servers, "-i", "5", "-l", "-s", "-c",
                        "2",
                        NULL
                };
                pid_t pid;

                _evalpid(nas_argv, NULL, 0, &pid);
                dd_syslog(LOG_INFO,
                          "ntpclient : ntp client successfully started\n");
        }             

        cprintf("done\n");
        return;       
}               
#endif
void stop_ntpc(void) 
{                 
        stop_process("ntpclient", "Network Time Protocol client");
        cprintf("done\n");
        return;       
}


As you can see in the code above the ntpclient is not started to run non-stop.

http://svn.dd-wrt.com:8000/browser/src/router/ntpclient/README
Code:

Usage: ntpclient [options]
options:
 -c count     stop after count time measurements (default 0 means go forever)
 -d           print diagnostics (feature can be disabled at compile time)
 -g goodness  causes ntpclient to stop after getting a result more accurate
                   than goodness (microseconds, default 0 means go forever)
 -h hostname  (mandatory) NTP server host, against which to measure system time
 -i interval  check time every interval seconds (default 600)
 -l           attempt to lock local clock to server using adjtimex(2)
 -p port      local NTP client UDP port (default 0 means "any available")
 -r           replay analysis code based on stdin
 -s           simple clock set (implies -c 1)


Also, this ntpclient is not the same as the ntp daemon you see on your linux box that reads from an /etc/ntp.conf configuration file.

_________________
(05/02/17) std - 31924
Linksys WRT400N
Buffalo WHR-G300N

Got OpenDNS?
hvengel
DD-WRT Novice


Joined: 19 Dec 2011
Posts: 2

PostPosted: Mon Dec 19, 2011 22:43    Post subject: Reply with quote
Yes I see that that this is running ntpclient and not ntpd. Is there a way to setup the ntp daemon instead of the ntpclient?

I see that ntpclient can be run as a daemon. Why not set this up as an option for dd-wrt users? Also the Linux kernel is now much more advanced in it's time handling (many improvements starting with 2.6.26) and the new kernel time keeping code is designed with using the ntp daemon in mind.
Luniz2k1
DD-WRT Guru


Joined: 04 Oct 2007
Posts: 1261
Location: Ohio USA

PostPosted: Mon Dec 19, 2011 23:02    Post subject: Reply with quote
hvengel wrote:
Yes I see that that this is running ntpclient and not ntpd. Is there a way to setup the ntp daemon instead of the ntpclient?

I see that ntpclient can be run as a daemon. Why not set this up as an option for dd-wrt users? Also the Linux kernel is now much more advanced in it's time handling (many improvements starting with 2.6.26) and the new kernel time keeping code is designed with using the ntp daemon in mind.

Take a look at:
http://svn.dd-wrt.com:8000/ticket/2153

_________________
(05/02/17) std - 31924
Linksys WRT400N
Buffalo WHR-G300N

Got OpenDNS?
Goto page Previous  1, 2, 3, 4 Display posts from previous:    Page 4 of 4
Post new topic   Reply to topic    DD-WRT Forum 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