Bug#408219: ntpd giving up on eth0 before it is initialized

2007-11-14 Thread Hugo Graumann
Hello.

I am wondering if the problem is just that the script
/etc/dhcp3/dhclient-enter-hooks.d/ntp is in the wrong
place. It should really be in the dhclient-exit-hooks.d
directory so that the script is run after dhcp has
completed initialization of the network instead of before.
Making this change seems to work over here. When I run
the command ifdown eth0 ; ifup eth0
 ntp now restarts and sees its peers as reachable and
then begins to run correctly.



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: ntpd giving up on eth0 before it is initialized

2007-10-03 Thread Aleksi Suhonen
Bon soir,

Arne Nordmark wrote:
}  I ran into this problem with eth1, my WLAN card. I found that
}  by moving the script from /etc/dhcp3/dhclient-enter-hooks.d to
}  /etc/dhcp3/dhclient-exit-hooks.d it is now executed at the
}  correct phase, after the interface has been given addresses.

}  Except ... scripts from that location aren't run when the dhcp
}  is invoked the very first time, only on subsequent invocations...

} Is this so? At least on etch, the /etc/dhcp3/dhclient-script ends with 
} the line
} exit_with_hooks 0
} and on my system, exit hooks seems to run at startup time. It seems 
} correct to run ntp_servers_setup_add at exit hook time, and possibly 
} keep ntp_servers_setup_remove running at enter hook time.

I perhaps re-posted a bit hastily. After moving the script and
rerunning ifdown/up it worked as expected, but then I tested
rebooting the machine too, and for some reason it didn't get
run. Since then it has been run every time.

So my original suggestion is fine and please ignore the re-post :-)

--
Aleksi Suhonen



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: ntpd giving up on eth0 before it is initialized

2007-10-02 Thread Arne Nordmark

I wrote:

I ran into this problem with eth1, my WLAN card. I found that
by moving the script from /etc/dhcp3/dhclient-enter-hooks.d to
/etc/dhcp3/dhclient-exit-hooks.d it is now executed at the
correct phase, after the interface has been given addresses.


Except ... scripts from that location aren't run when the dhcp
is invoked the very first time, only on subsequent invocations...



Is this so? At least on etch, the /etc/dhcp3/dhclient-script ends with 
the line

exit_with_hooks 0
and on my system, exit hooks seems to run at startup time. It seems 
correct to run ntp_servers_setup_add at exit hook time, and possibly 
keep ntp_servers_setup_remove running at enter hook time.



--
Aleksi Suhonen


Arne Nordmark




--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: ntpd giving up on eth0 before it is initialized

2007-09-12 Thread Aleksi Suhonen
Hello,

I ran into this problem with eth1, my WLAN card. I found that
by moving the script from /etc/dhcp3/dhclient-enter-hooks.d to
/etc/dhcp3/dhclient-exit-hooks.d it is now executed at the
correct phase, after the interface has been given addresses.

It would also be nice, if there was a way to specify persistent
ntp servers, I.e. that there were some server/peer lines that
wouldn't be stripped when forming /etc/ntp.conf.dhcp.

For example:

  sed -r -e '/persistent/{;n;n;};/^ *(server|peer).*$/d' $NTP_CONF

Which would always leave lines following the string persistent alone:

 # the following server should stay in the conf file persistently:
  server my.globally.available.ntp.server
 # the following server should be stripped:
  server strippable.ntp.server

--
Aleksi Suhonen

() ascii ribbon campaign
/\ support plain text e-mail



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: ntpd giving up on eth0 before it is initialized

2007-09-12 Thread Aleksi Suhonen
I wrote:
 I ran into this problem with eth1, my WLAN card. I found that
 by moving the script from /etc/dhcp3/dhclient-enter-hooks.d to
 /etc/dhcp3/dhclient-exit-hooks.d it is now executed at the
 correct phase, after the interface has been given addresses.

Except ... scripts from that location aren't run when the dhcp
is invoked the very first time, only on subsequent invocations...

Perhaps ntpd should be restarted on the background with
a five second delay?

--
Aleksi Suhonen

() ascii ribbon campaign
/\ support plain text e-mail



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: [pkg-ntp-maintainers] Bug#408219: ntpd giving up on eth0 before it is initialized

2007-06-17 Thread Thomas Fritz
I ran into the same problem. Here some more information.

On startup (boot process) of my Debian/Etch dhcp/ntp clients, the hook

   /etc/dhcp3/dhclient-enter-hooks.d/ntp

gets called, (re)starting ntpd at a point in time (DHCP BOUND), when the
network is not configured yet. Some seconds later the init script

   /etc/init.d/ntp

attempts to start ntpd, but the start-stop-daemon just exits, since ntpd
is already running. Hence, ntpd stays in an offline state as Erik
explained.

On shutdown of the clients, the script

   /etc/init.d/ntp

stops ntpd, but it is (re)started again by the hook

   /etc/dhcp3/dhclient-enter-hooks.d/ntp

some seconds later (DHCP RELEASE). Then the systems gets down.


This can be worked around by replacing the line

  invoke-rc.d ntp restart

with

  invoke-rc.d ntp try-restart

in function 'ntp_server_restart()' of the hook.

Now, when the hook is called on startup/shutdown it does not
(needlessly) start ntpd anymore, and the startup/shutdown behaviour is
controlled by the init scripts alone.

The general problem, however, remains. I.e., when restarting the network
on the client:

   # /etc/init.d/networking restart

   Reconfiguring network interfaces...
There is already a pid file /var/run/dhclient.eth0.pid with pid 1687
   killed old client process, removed PID file
   Internet Systems Consortium DHCP Client V3.0.4
   Copyright 2004-2006 Internet Systems Consortium.
   All rights reserved.
   For info, please visit http://www.isc.org/sw/dhcp/

   Listening on LPF/eth0/00:14:bf:65:ad:b5
   Sending on   LPF/eth0/00:14:bf:65:ad:b5
   Sending on   Socket/fallback
   DHCPRELEASE on eth0 to 172.20.1.6 port 67
   Stopping NTP server: ntpd.
   Starting NTP server: ntpd.
   Internet Systems Consortium DHCP Client V3.0.4
   Copyright 2004-2006 Internet Systems Consortium.
   All rights reserved.
   For info, please visit http://www.isc.org/sw/dhcp/

   Listening on LPF/eth0/00:14:bf:65:ad:b5
   Sending on   LPF/eth0/00:14:bf:65:ad:b5
   Sending on   Socket/fallback
   DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
   DHCPOFFER from 172.20.1.6
   DHCPREQUEST on eth0 to 255.255.255.255 port 67
   DHCPACK from 172.20.1.6
   Stopping NTP server: ntpd.
   Starting NTP server: ntpd.
   bound to 172.20.1.9 -- renewal in 237 seconds.
   done.

then ntpd is left offline by the second stop/start of the NTP server,
because the network interface is not configured at that point.




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: [pkg-ntp-maintainers] Bug#408219: ntpd giving up on eth0 before it is initialized

2007-04-10 Thread Peter Eisentraut
Erik Thiele wrote:
 the problem now is that the dhclient sets networking parameters after
 ntpd has already started. dhclient won't restart ntpd because
 configuration hasn't changed.

So what is the actual problem?  ntp.conf.dhcp is not created, or it 
doesn't contain the right information, or ntpd is not restarted?

 this way ntpd will fail on the ip 
 adress because the ethernet is down.

Why would the ethernet be down after calling dhclient?  An why is that 
ntpd's fault?


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: [pkg-ntp-maintainers] Bug#408219: ntpd giving up on eth0 before it is initialized

2007-04-10 Thread Erik Thiele
Am Dienstag, 10. April 2007 22:27 schrieben Sie:
 Erik Thiele wrote:
  the problem now is that the dhclient sets networking parameters after
  ntpd has already started. dhclient won't restart ntpd because
  configuration hasn't changed.

 So what is the actual problem?  ntp.conf.dhcp is not created, or it
 doesn't contain the right information, or ntpd is not restarted?

ntpd is not restarted is the problem.


  this way ntpd will fail on the ip
  adress because the ethernet is down.

 Why would the ethernet be down after calling dhclient?  An why is that
 ntpd's fault?

the ethernet was down before dhclient. ntpd decided that the ntp host is down, 
and will not rethink this decission just because the ethernet gets up at some 
point in time.


1)  from a former run i have correct data in ntpd.conf.dhcp

2)  ntpd is running, but networking is not yet brought up, dhcp requests are 
not yet replied by the server.

3) ntpd thus tries to contact my old ntp.my.lan server, and finds out that 
this does not work. it now decides that the server is broken.

4) dhclient activates networking and finds out that ntpd.conf.dhcp is not 
changed, so he does not restart ntpd

5) but ntpd has already decided that the ethernet does not work and will never 
rethink it's decission and stay in this mode forever:

ntpq -p
 remote   refid  st t when poll reach   delay   offset  jitter
==
 wo.x.lan .INIT.  16 --   6400.0000.000   0.000

6) i manually restart ntpd and it instantly works.


 if the configuration file ntpd.conf.dhcp has not changed on dhcp 
startup, then anyway ntpd has to be restarted because the actual difference 
between before and after dhclient run is that before the ethernet is down and 
the host unreachable, and afterwards the ethernet is up and the host is 
reachable.



cya
erik


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#408219: ntpd giving up on eth0 before it is initialized

2007-01-24 Thread Erik Thiele
Package: ntp
Version: 4.2.2.p4+dfsg-1

my ethernet is configured via dhcp:

goofy:/etc# cat network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp

i added
request ntp-servers;
to /etc/dhcp3/dhclient.conf

so that ntpd.conf.dhcp gets created. see bug #407667.

the problem now is that the dhclient sets networking parameters after ntpd has 
already started. dhclient won't restart ntpd because configuration hasn't 
changed. this way ntpd will fail on the ip adress because the ethernet is 
down. it will remain like this forever:

ntpq -p
 remote   refid  st t when poll reach   delay   offset  jitter
==
 wo.x.lan .INIT.  16 --   6400.0000.000   0.000

if i restart ntpd it will work.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]