From owner-freebsd-stable@FreeBSD.ORG Wed Nov 30 02:01:29 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B177016A41F for ; Wed, 30 Nov 2005 02:01:29 +0000 (GMT) (envelope-from ian_leroux@fastmail.fm) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A42343D81 for ; Wed, 30 Nov 2005 02:01:28 +0000 (GMT) (envelope-from ian_leroux@fastmail.fm) Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id 9E3A8D17FC6 for ; Tue, 29 Nov 2005 21:01:26 -0500 (EST) Received: from frontend2.messagingengine.com ([10.202.2.151]) by frontend1.internal (MEProxy); Tue, 29 Nov 2005 21:01:26 -0500 X-Sasl-enc: YKbeGmb7GfX8nhWDvUcuUcgXujyMfrMN0QwO/XS+6hbo 1133316085 Received: from TANG-FIVE-EIGHTY-ONE.MIT.EDU (TANG-FIVE-EIGHTY-ONE.MIT.EDU [18.251.7.70]) by frontend2.messagingengine.com (Postfix) with ESMTP id 840C15713C0 for ; Tue, 29 Nov 2005 21:01:24 -0500 (EST) From: "Ian D. Leroux" To: freebsd-stable@freebsd.org Content-Type: text/plain Date: Tue, 29 Nov 2005 21:01:16 -0500 Message-Id: <1133316076.522.28.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Subject: Restarting ntpd on address change X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: ian_leroux@fastmail.fm List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2005 02:01:29 -0000 Greetings, My machine's ip address is assigned by DHCP, and whenever it changes ntpd stops functioning and must be restarted. I gather this behavior will be changed in some future ntpd version, but in the meantime I had added a line to my /etc/dhclient-exit-hooks to restart ntpd every time a new address was obtained: # [...] setup variables for ipcheck if [ -n "$new_ip_address" ]; then # [...] run ipcheck to update my dyndns /etc/rc.d/ntpd restart fi This seemed work fine on 5.4, but on 6.0 it gives problems at boot. Specifically, I get repeated "bad file descriptor" errors after my network address is assigned, and running ps after the boot completes shows that there are two ntpd processes running. Killing one of them stops the file descriptor errors. My interpretation of this (for what it's worth) is that an ntpd process gets started before dhclient gets a chance to configure the address (perhaps when the interface initially comes up) and then when the address is assigned the /etc/rc.d/ntpd restart starts a second process, but somehow fails to stop the first one. For now I've removed that line from dhclient-exit-hooks, which avoids the problems at boot time. I have the feeling that I'm not doing the Right Thing here. So is there an accepted (or at least known-good) way of automatically managing the restart of ntpd on address change? Have I found a bug in rc.d worth investigating? Or should I just stick to manual restarts until ntpd stops needing them? Thanks, Ian D. Leroux