Minor issues of time on PPC

Garance A Drosihn drosih at rpi.edu
Tue Jul 19 16:48:19 GMT 2005


At 8:48 AM -0400 7/19/05, Joshua Coombs wrote:
>Garance A Drosihn" <drosih at rpi.edu> writes:
>>
>>Hmm.  I just noticed that ntpd is running with
>>'-f /var/db/ntpd.drift' -- but that file does not exist.  But
>>then, it doesn't exist on my other freebsd machines, and they
>>all seem to keep accurate time.  Still, I'm going to try
>>creating that file and see if it does any good.

>Easiest way to prevent this, have more than 2 servers listed.

We have two ntp servers on campus, and I'll change my ntp.conf
to use both of them instead of just one.  I've always meant to
do that anyway.

>This conf pulls 3 servers from the public ntp pool project,
>and sets up a 'local' refrence clock to fall back to should
>all three remote servers go down.

If our two ntp servers go down, then (a) I'll certainly know
about it, and (b) I'll have much much bigger concerns than
whether my Mac-mini is off by a few minutes!   :-)

>example /etc/rc.conf settings:
>ntpdate_enable="YES"
>ntpdate_flags="-g -q -N high"
>ntpdate_program="/usr/sbin/ntpd"

Okay, so I added these to rc.conf, and did:

   (38)  /etc/rc.d/ntpdate start
   Setting date via ntp.
   usage: /usr/sbin/ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]
                   [ -f freq_file ] [ -k key_file ] [ -l log_file ]
                   [ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
                   [ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]

There is no -N supported.  So I dropped that, and still got the
error message.  Turns out that the way /etc/rc.d/ntpdate works,
it ends up running:
    /usr/sbin/ntpd -g -q ntp.rpi.edu ntp1.rpi.edu

I changed the rc.conf to add:
    ntpdate_hosts="-c /etc/ntp.conf"

and then got:
    (43)  /etc/rc.d/ntpdate start
    Setting date via ntp.
    ntpd: time set +9.014549s

My guess is that few people have tried to config ntpdate in this
manner.  Looking at /etc/defaults/rc.conf, maybe I should set:
    ntpd_sync_on_start="YES"
    ntpdate_enable="NO"

>xntpd_enable="YES"
>xntpd_flags="-g -p /var/run/ntpd.pid"

These variables don't exist.  Are you working with the /etc/rc
files from an earlier release of FreeBSD?  In 6.x, there is
no 'x' in the variable names.

>Try this, let the machine run for a couple hours, then email
>the output of:
>    ntpdc -c loopinfo
>    ntpdc -c kerninfo
>    ntpq -p
>
>Based on that, we can see if ntp is at fault, or something
>else is up.

Okay, I've got that running, and I'll get back with those details
later tonight or tomorrow.  Thanks for these ideas.

><snip>
>>(other examples:
>>   - locate doesn't seem to work at all, which I actually
>>     have started to look into a bit.
>>
>Does it complain there isn't a locate db?

No.  There are no error message, but it does not work.  For instance,
a 'locate a' command gives me a list that starts out:

/ec
/ec
/ec
/ec

...and I have no file or directory named /ec.  I can destroy and
rebuild the locate database, and I get the same results.

Looking at the algorithm used by the locate programs, it is almost
certain that somewhere it is using a 'char' and expecting that to
be 'signed char', when on PowerPC it is 'unsigned char'...  It is
doing a number of clever things with 'char' variables, sometimes
explicitly using 'unsigned char', and other times using plain
'char' (and probably assuming those are signed).

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-ppc mailing list