[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: getting correct time on a laptop (IBM ThinkPad T23)



Am Mittwoch 21 Juni 2006 17:02 schrieb Paul Kimoto:

> Do you invoke the (chronyc) "trimrtc" command?  (If this works, you
> probably want to "writertc" as well.)
>
> Does your computer have a way to get IP addresses of external NTP
> servers when chronyd starts (even if the network is down)?  I believe
> that otherwise chronyd forgets about those servers and never tries to
> contact them.

Hello Paul,

my setup didn't work yet... I had to add further foo magic to make it 
work... this is getting ridiculous. ;(


When network is up, I add a at job to handle chrony at a later time. 
Background: My DSL router my take some time to initialize the DSL 
connection and chrony simply would not work correctly when connection is 
not available when it starts. I have to do this asynchronously, as 
otherwise ifplugd would block for at least one minute:

root@deepdance:~ -> cat /etc/network/if-up.d/chrony
#!/bin/sh

# Start chrony stuff in at least one minute, lets see whether that works, 
26.6.2006
at -f /etc/chrony/network-up.sh now + 2 minutes


So I restart chrony at least 1 minute after network has been brought up, 
then I wait a while and then I tell it to go online... if I do not wait 
chronyc will hang:

root@deepdance:~ -> cat /etc/chrony/network-up.sh
#!/bin/sh
# This script tells chronyd that the connection is up so that it can
# contact the server.  John Hasler <jhasler@debian.org> 1998-2003
# Any possessor of a copy of this program may treat it as if it
# were in the public domain.  I waive all rights.

# Debugging?
#set -x

# Put a hint in the log file that we are running
logger "/etc/chrony/network-up.sh: restarting chrony and put it online."

# Make sure that chrony does DNS lookups, 25.6.2006, martin
# Should better wait till pool.ntp.org can be accessed!
# but for now I tell at to defer it about a minute, 25.6.2006, martin
/etc/init.d/chrony restart

# Otherwise chronyc will hang ;(, oh man this is sucking so extremely, 
26.6.2006, martin
sleep 5

# Copied from /etc/ppp/ip-up.d/chrony, just modified the /var/run 
filename, 25.6.2006, martin
/bin/pidof chronyd > /dev/null || exit 0
KEY=$(awk '$1 ~ /^commandkey$/ { print $2; exit}' /etc/chrony/chrony.conf)
PASSWORD=`awk '$1 ~ /^'$KEY'$/ {print $2; exit}' /etc/chrony/chrony.keys`
/usr/bin/chronyc << EOF
password $PASSWORD
online
EOF
touch /var/run/chrony-eth0-up
exit 0


I had a "burst 5/5" after the "online" command, but right now I am testing 
whether it works without it.

Regards,
-- 
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA  B82F 991B EAAC A599 84C7



Reply to: