|
|
|
|
||||||
| linux.debian.user debian-user@lists.debian.org. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
I'm running debian/unstable on my laptop and often the LAN/WLAN is not connected (yet) when the system is starting up - including NTPD. NTPD then seems to discard all unreachable server entries and ends up with no peers left. In some googled doc I found the ntp.conf option "dynamic" to tell it that some peers may become available later on, but the debian ntpd doesnt't seem to understand it - or I don't know how to use it correctly. What is the best way to configure the ntpd in such an environment ? TIA, Bruno -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
On Tue, Jan 23, 2007 at 01:49:55AM +0100, Bruno Voigt wrote:
> I'm running debian/unstable on my laptop and often the LAN/WLAN is not > connected (yet) > when the system is starting up - including NTPD. > > NTPD then seems to discard all unreachable server entries and ends up > with no peers left. > In some googled doc I found the ntp.conf option "dynamic" to tell it > that some peers may become available later on, > but the debian ntpd doesnt't seem to understand it - or I don't know how > to use it correctly. > > What is the best way to configure the ntpd in such an environment ? How about calling the init.d script from /etc/network/interfaces? I mean, there is little need for having the deamon running while offline and providing that your clock does not drift too much, that should do it. jacques -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFtb5CoYczEVPGNVERAgVhAJ9QAcwVDF+J0UbVly0lY3 +PcFnBNQCeMWOy w9+CcD26U4ONOj6qCjn0bl8= =NC/1 -----END PGP SIGNATURE----- |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Jacques Normand wrote:
>> I'm running debian/unstable on my laptop and often the LAN/WLAN is not >> connected (yet) >> when the system is starting up - including NTPD. >> >> NTPD then seems to discard all unreachable server entries and ends up >> with no peers left. >> In some googled doc I found the ntp.conf option "dynamic" to tell it >> that some peers may become available later on, >> but the debian ntpd doesnt't seem to understand it - or I don't know how >> to use it correctly. >> >> What is the best way to configure the ntpd in such an environment ? >> > > How about calling the init.d script from /etc/network/interfaces? > > I mean, there is little need for having the deamon running while > offline and providing that your clock does not drift too much, that > should do it. > That is hard to configure reliable because of stuff like openvpn that also needs a varying timespan to settle etc.. So I would really like to know a way to tell ntpd to not give up on a server entry if it is not reachable/resolvable on the first try: Jan 23 21:06:27 europa ntpd_initres[5255]: host name not found: 0.debian.pool.ntp.org │ Jan 23 21:06:27 europa ntpd_initres[5255]: couldn't resolve `0.debian.pool.ntp.org', giving up on it │ Bruno -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On Tue, Jan 23, 2007 at 08:53:55PM +0100, Bruno Voigt wrote:
> >How about calling the init.d script from /etc/network/interfaces? > > > >I mean, there is little need for having the deamon running while > >offline and providing that your clock does not drift too much, that > >should do it. > > > That is hard to configure reliable because of stuff like openvpn that > also needs a varying timespan to settle etc.. > So I would really like to know a way to tell ntpd to not give up on a > server entry if it is not reachable/resolvable on the first try: > > Jan 23 21:06:27 europa ntpd_initres[5255]: host name not found: > 0.debian.pool.ntp.org ??? > Jan 23 21:06:27 europa ntpd_initres[5255]: couldn't resolve > `0.debian.pool.ntp.org', giving up on it ??? If you really wish to have ntpd running all the time, you can still add/remove peers dynamically. ntpdc -c addserver peer_address [keyid] [version] [prefer] ntpdc -c unconfig peer_address I don't there is any way to get away from the synchronization time though. So running ntpd without peers versus not running it at all should not make any difference except if your clock is very biased and you stay offline for a long time. I also do not know what happen at startup to correct for the skew of the rtc during the shutdown. If it is taken care of by ntpd at start, then you have one less reason to leave it on... jacques -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFFtp/IoYczEVPGNVERAglHAJ4/XmtBvGHWY5ZNCBp4MAX3HzhZIACguU3r bIbO9AZjokL/KZUVkJ2AhD4= =/AY+ -----END PGP SIGNATURE----- |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
On Jan 23, 2007, at 2:53 PM, Bruno Voigt wrote: > Jacques Normand wrote: >>> I'm running debian/unstable on my laptop and often the LAN/WLAN >>> is not connected (yet) >>> when the system is starting up - including NTPD. >>> >>> NTPD then seems to discard all unreachable server entries and >>> ends up with no peers left. >>> In some googled doc I found the ntp.conf option "dynamic" to tell >>> it that some peers may become available later on, >>> but the debian ntpd doesnt't seem to understand it - or I don't >>> know how to use it correctly. >>> >>> What is the best way to configure the ntpd in such an environment ? >>> >> >> How about calling the init.d script from /etc/network/interfaces? >> >> I mean, there is little need for having the deamon running while >> offline and providing that your clock does not drift too much, that >> should do it. >> > That is hard to configure reliable because of stuff like openvpn > that also needs a varying timespan to settle etc.. > So I would really like to know a way to tell ntpd to not give up on > a server entry if it is not reachable/resolvable on the first try: > > Jan 23 21:06:27 europa ntpd_initres[5255]: host name not found: > 0.debian.pool.ntp.org │ > Jan 23 21:06:27 europa ntpd_initres[5255]: couldn't resolve > `0.debian.pool.ntp.org', giving up on it │ Try replacing the symbolic name in one of the "server" lines in /etc/ ntp.conf with an absolute IP address. Then comment out (or simply remove) all the other servers to minimize clutter. It might also be a good idea to add the "minpoll 10" option to the server you keep. E.g. The default /etc/ntp.conf file has (just the server lines): server 0.debian.pool.ntp.org iburst server 1.debian.pool.ntp.org iburst server 2.debian.pool.ntp.org iburst server 3.debian.pool.ntp.org iburst Replace them with the single line: server xx.yy.zz.ww minpoll 10 iburst Where xx.yy.zz.ww is chosen from one of the numeric IP addresses returned by doing host pool.ntp.org This will avoid the "can't resolve, so giving up" phenomenon because the IP address is already known and doesn't need to be resolved. It will also tell ntpd to poll no more than often than once every 1024 seconds (about 17 minutes), which will reduce the frequency of useless ntp packets that can't be delivered. Without the "minpoll 10" it will default to "minpoll 6" which will poll every 64 seconds (about 1 minute). If you don't usually stay connected to the internet for longer than a half-hour or so at a time, try "minpoll 8" which will poll every 256 seconds (4-5 minutes). The object is to get a few polls out to the server and back during each period of internet connectivity. The downside is that you have to pick one of the pool.ntp.org servers and stick with it. If it goes down or leaves the net, you have to be aware of that possibility and be ready to choose a different server when it happens. Using a symbolic DNS address (default for those with reliable internet connections, but not a viable option for you) will get a random choice from a known-good list each time ntpd is started up. I've deliberately avoided giving a particular IP address (used xx.yy.zz.ww, instead) to avoid having a bunch of novices bombarding some unfortunate single server in the case that this advice gets posted to a wiki and used by lots of folks. So, "some assembly required" is the price of life in the real world. Hope this s! Rick |
|
|
|
#6 |
|
Messages: n/a
Hébergeur: |
On Tue, 23 Jan 2007, Jacques Normand wrote:
> you stay offline for a long time. I also do not know what happen at > startup to correct for the skew of the rtc during the shutdown. If it is > taken care of by ntpd at start, then you have one less reason to leave > it on... ntp can do two things. It can "step" time, which is dangerous if it makes the clock go backwards in an already running system (i.e. not during early startup), or it can slew time (make the clock slow down a bit or go a bit faster) until the time is correct. If the difference is too big, slewing is not possible, as slewing cannot make the clock run that much faster or that much slower than real time for obvious reasons. If ntp is slewing time, you better don't kill it until it is done. Anyway, if the machine is not going to be connected to a network with timeservers most of the time, install the "chrony" package instead of ntp. "chrony" is designed for this kind of situation, where the machine stays a lot of time offline. It will keep time correct better than NTP in such a situation, and it will be easier on the time servers too. ntp really *is* for machines that are constantly in contact with either other ntp servers, or directly connected to a reference clock (GPS, atomic clock, etc). For all other uses, you have "chrony". As for ntpdate, it is something you should just use when the system is in single user mode or during early startup. -- "One disk to rule them all, One disk to find them. One disk to bring them all and in the darkness grind them. In the Land of Redmond where the shadows lie." -- The Silicon Valley Tarot Henrique Holschuh -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#7 |
|
Messages: n/a
Hébergeur: |
On 23.01.07 01:49, Bruno Voigt wrote:
> I'm running debian/unstable on my laptop and often the LAN/WLAN is not > connected (yet) when the system is starting up - including NTPD. > > NTPD then seems to discard all unreachable server entries and ends up with > no peers left. In some googled doc I found the ntp.conf option "dynamic" > to tell it that some peers may become available later on, but the debian > ntpd doesnt't seem to understand it - or I don't know how to use it > correctly. > > What is the best way to configure the ntpd in such an environment ? I use chrony on my laptop. It supports online and offline mode, however in sarge it only has up/down scripts in ppp subdirectories (not very good since I usually plug in ethernet). However I'm quite satisfied with it and when needed I run those scripts manually. I was thinking about creating ip-up.d and ip-down.d scripts (very elegant with ifplugd) which will set proper mode, and probably the provided NTP server (from dhcp or ppp config) too. Maybe something alike is in etch already... -- Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/ Warning: I wish NOT to receive e-mail advertising to this address. Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu. One OS to rule them all, One OS to find them, One OS to bring them all and into darkness bind them -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#8 |
|
Messages: n/a
Hébergeur: |
On Fri, Jan 26, 2007 at 07:31:08PM +0100, Matus UHLAR - fantomas wrote:
> On 23.01.07 01:49, Bruno Voigt wrote: > > I'm running debian/unstable on my laptop and often the LAN/WLAN is not > > connected (yet) when the system is starting up - including NTPD. > > > > NTPD then seems to discard all unreachable server entries and ends up with > > no peers left. In some googled doc I found the ntp.conf option "dynamic" > > to tell it that some peers may become available later on, but the debian > > ntpd doesnt't seem to understand it - or I don't know how to use it > > correctly. > > > > What is the best way to configure the ntpd in such an environment ? > > I use chrony on my laptop. It supports online and offline mode, however in > sarge it only has up/down scripts in ppp subdirectories (not very good since > I usually plug in ethernet). However I'm quite satisfied with it and when > needed I run those scripts manually. I was thinking about creating ip-up.d > and ip-down.d scripts (very elegant with ifplugd) which will set proper > mode, and probably the provided NTP server (from dhcp or ppp config) too. > I used to run chrony (with difficulty) but ran into a problem with my new box: it couldn't access the hwclock. If I told it not to, (so that the hwclock shutdown script could work), it really messed up my time. So I switched to ntp. I access the net with ppp and put a script into ip-up.d to restart ntp when the link comes up. Yes, ntp will jump instead of skew since a skew can take a __very__ long time to accomplish. With fewer and fewer people using dial-up I feel a bit orphaned at times and ntp/chrony is one of them. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#9 |
|
Messages: n/a
Hébergeur: |
Douglas Allan Tutty <dtutty@porchlight.ca> writes:
> I used to run chrony (with difficulty) but ran into a problem with my > new box: it couldn't access the hwclock. If I told it not to, (so that > the hwclock shutdown script could work), it really messed up my time. > So I switched to ntp. I access the net with ppp and put a script into > ip-up.d to restart ntp when the link comes up. Yes, ntp will jump > instead of skew since a skew can take a __very__ long time to > accomplish. > > With fewer and fewer people using dial-up I feel a bit orphaned at times > and ntp/chrony is one of them. You might want to look into something like what I do. I use ntpdate to set the time daily over ppp, but then I manually track the offset and use adjtimex to adjust the kernel clock. I have it set well enough that the average slew is about 30 msec/day. I think this is basically what chrony does automatically, but I was using this before chrony was available. -- Carl Johnson carlj@peak.org -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#10 |
|
Messages: n/a
Hébergeur: |
On Jan 27, 2007, at 2:19 PM, Douglas Allan Tutty wrote: > I used to run chrony (with difficulty) but ran into a problem with my > new box: it couldn't access the hwclock. If I told it not to, (so > that > the hwclock shutdown script could work), it really messed up my time. > So I switched to ntp. I access the net with ppp and put a script into > ip-up.d to restart ntp when the link comes up. Yes, ntp will jump > instead of skew since a skew can take a __very__ long time to > accomplish. If you're running "etch", you might want to try the etch "ntpdate" package. It's configured to run ntpdate and jump the clock to the correct time every time a network interface is brought up. You should probably not run ntp at the same time -- in this mode, the two will fight about who controls the system clock. Rick -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#11 |
|
Messages: n/a
Hébergeur: |
On Sun, Jan 28, 2007 at 12:56:02AM -0500, Rick Thomas wrote:
> > On Jan 27, 2007, at 2:19 PM, Douglas Allan Tutty wrote: > > >I used to run chrony (with difficulty) but ran into a problem with my > >new box: it couldn't access the hwclock. If I told it not to, (so > >that > >the hwclock shutdown script could work), it really messed up my time. > >So I switched to ntp. I access the net with ppp and put a script into > >ip-up.d to restart ntp when the link comes up. Yes, ntp will jump > >instead of skew since a skew can take a __very__ long time to > >accomplish. > > > If you're running "etch", you might want to try the etch "ntpdate" > package. It's configured to run ntpdate and jump the clock to the > correct time every time a network interface is brought up. You > should probably not run ntp at the same time -- in this mode, the two > will fight about who controls the system clock. > The ntp docs say that ntpdate will (as they put it, after an appropriate period of mourning) be obsolete now that ntp has the -q option. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#12 |
|
Messages: n/a
Hébergeur: |
On Monday 22 January 2007 16:49, Bruno Voigt wrote:
> Hi, > I'm running debian/unstable on my laptop and often the LAN/WLAN is not > connected (yet) > when the system is starting up - including NTPD. > > NTPD then seems to discard all unreachable server entries and ends up > with no peers left. > In some googled doc I found the ntp.conf option "dynamic" to tell it > that some peers may become available later on, > but the debian ntpd doesnt't seem to understand it - or I don't know how > to use it correctly. > > What is the best way to configure the ntpd in such an environment ? Just configure ntpd as normal, but add an hourly cronjob which does "/etc/init.d/ntp restart >/dev/null". A client has a server on PPPOE where ntpd always fails at the outset. Using this, rather than ntpdate, results in the clock staying in sync without stepping. The hwclock is good enough for ntpd after reboot (or DSL outage) until the next time the cronjob runs. --Mike Bird -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#13 |
|
Messages: n/a
Hébergeur: |
On Jan 28, 2007, at 3:34 PM, Mike Bird wrote: > On Monday 22 January 2007 16:49, Bruno Voigt wrote: >> Hi, >> I'm running debian/unstable on my laptop and often the LAN/WLAN is >> not >> connected (yet) >> when the system is starting up - including NTPD. >> >> NTPD then seems to discard all unreachable server entries and ends up >> with no peers left. >> In some googled doc I found the ntp.conf option "dynamic" to tell it >> that some peers may become available later on, >> but the debian ntpd doesnt't seem to understand it - or I don't >> know how >> to use it correctly. >> >> What is the best way to configure the ntpd in such an environment ? > > Just configure ntpd as normal, but add an hourly cronjob which does > "/etc/init.d/ntp restart >/dev/null". > > A client has a server on PPPOE where ntpd always fails at the outset. > Using this, rather than ntpdate, results in the clock staying in sync > without stepping. The hwclock is good enough for ntpd after reboot > (or DSL outage) until the next time the cronjob runs. > > --Mike Bird I like that idea. It avoids ntpdate, which (for better or for worse, is deprecated by the NTP developers and will not be getting timely updates in the future) and it gives ntpd a chance to do it's starting transient thing (fairly recently added) and thus get the parameters right if it can talk to the Internet servers. And it does no (serious) harm if you're disconnected from the Internet when the cron runs. Worth a try! Rick -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#14 |
|
Messages: n/a
Hébergeur: |
On Jan 28, 2007, at 3:34 PM, Mike Bird wrote: > On Monday 22 January 2007 16:49, Bruno Voigt wrote: >> Hi, >> I'm running debian/unstable on my laptop and often the LAN/WLAN is >> not >> connected (yet) >> when the system is starting up - including NTPD. >> >> NTPD then seems to discard all unreachable server entries and ends up >> with no peers left. >> In some googled doc I found the ntp.conf option "dynamic" to tell it >> that some peers may become available later on, >> but the debian ntpd doesnt't seem to understand it - or I don't >> know how >> to use it correctly. >> >> What is the best way to configure the ntpd in such an environment ? > > Just configure ntpd as normal, but add an hourly cronjob which does > "/etc/init.d/ntp restart >/dev/null". > > A client has a server on PPPOE where ntpd always fails at the outset. > Using this, rather than ntpdate, results in the clock staying in sync > without stepping. The hwclock is good enough for ntpd after reboot > (or DSL outage) until the next time the cronjob runs. > > --Mike Bird I like that idea. It avoids ntpdate, which (for better or for worse, is deprecated by the NTP developers and will not be getting timely updates in the future) and it gives ntpd a chance to do it's starting transient thing (fairly recently added) and thus get the parameters right if it can talk to the Internet servers. And it does no (serious) harm if you're disconnected from the Internet when the cron runs. Worth a try! Rick -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
|
|
#15 |
|
Messages: n/a
Hébergeur: |
On Sun, Jan 28, 2007 at 12:34:10PM -0800, Mike Bird wrote:
> On Monday 22 January 2007 16:49, Bruno Voigt wrote: > > Hi, > > I'm running debian/unstable on my laptop and often the LAN/WLAN is not > > connected (yet) > > when the system is starting up - including NTPD. > > > > NTPD then seems to discard all unreachable server entries and ends up > > with no peers left. > > In some googled doc I found the ntp.conf option "dynamic" to tell it > > that some peers may become available later on, > > but the debian ntpd doesnt't seem to understand it - or I don't know how > > to use it correctly. > > > > What is the best way to configure the ntpd in such an environment ? > > Just configure ntpd as normal, but add an hourly cronjob which does > "/etc/init.d/ntp restart >/dev/null". > > A client has a server on PPPOE where ntpd always fails at the outset. > Using this, rather than ntpdate, results in the clock staying in sync > without stepping. The hwclock is good enough for ntpd after reboot > (or DSL outage) until the next time the cronjob runs. > Or, if you have some scriptable way to tell if the net is up (a ping to the ntp server?), you could put a script as the last to run in the network ip-up.d. Have it sit there polling (intermittant ping?) the server every minute until it gets a response then /etc/init.d/ntp restart, then exit. This would avoid the net-up just after the cron job goes then having to wait an hour before ntp is connected. Doug. -- To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org |
|
![]() |
| Outils de la discussion | |
|
|