Restarting ntpd on address change

From: Ian D. Leroux (ian_leroux_at_fastmail.fm)
Date: 11/30/05

  • Next message: Brooks Davis: "Re: Restarting ntpd on address change"
    To: freebsd-stable@freebsd.org
    Date: Tue, 29 Nov 2005 21:01:16 -0500
    
    

    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

    _______________________________________________
    freebsd-stable@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-stable
    To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"


  • Next message: Brooks Davis: "Re: Restarting ntpd on address change"

    Relevant Pages

    • Re: Restarting ntpd on address change
      ... > ntpd stops functioning and must be restarted. ... > shows that there are two ntpd processes running. ... > restart starts a second process, but somehow fails to stop the first ...
      (freebsd-stable)
    • Re: Restarting ntpd on address change
      ... ntpd stops functioning and must be restarted. ... /etc/rc.d/ntpd restart ... Killing one of them stops the file descriptor errors. ... My interpretation of this is that an ntpd process gets started before dhclient gets a chance to configure the address 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. ...
      (freebsd-stable)
    • Re: ntpd vs selinux
      ... It appears that the last selinux update has killed ntpd, as shown from my messages log: ... So to get a clean restart, I did a restart, and this error was logged. ... If ntpd is still not working, the problem lies elsewhere than SELinux. ...
      (Fedora)
    • Re: ntpd vs selinux
      ... It appears that the last selinux update has killed ntpd, as shown from my messages log: ... So to get a clean restart, I did a restart, and this error was logged. ... If ntpd is still not working, the problem lies elsewhere than SELinux. ...
      (Fedora)
    • Re: ntpd vs selinux
      ... It appears that the last selinux update has killed ntpd, as shown from my messages log: ... So to get a clean restart, I did a restart, and this error was logged. ... If ntpd is still not working, the problem lies elsewhere than SELinux. ...
      (Fedora)