Perhaps a solution is to add an ifupdown hook restarting chrony when a
network interface is taken up?  This is the one used by ntp
(/etc/network/if-up.d/ntp):

  #!/bin/sh

  # remove (or comment out) the next line if your network addresses change
  #exit 0

  case $ADDRFAM in
        inet*)
                if [ -x "/etc/init.d/ntp" ]; then
                        if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
                                invoke-rc.d ntp restart || exit $?
                        else
                                /etc/init.d/ntp restart || exit $?
                        fi
                fi
                ;;
  esac

The ntp package also have dhcp hooks.  Perhaps that is a better
choice?  See /etc/dhcp3/dhclient-exit-hooks.d/ntp and
/etc/dhcp3/dhclient-enter-hooks.d/ntp in the ntp package.  Perhaps all
of them are needed, to cope with network showing up both at boot and
after hibernation.

Happy hacking,
-- 
Petter Reinholdtsen



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

Reply via email to