On Tue, Jan 2, 2018 at 10:22 PM, Bernhard Schmidt <[email protected]> wrote: > On Thu, May 05, 2016 at 01:44:06PM -0500, Christian Ehrhardt wrote: > > Hi Christian, > > thanks for bringing this up. > >> While these days the systemd based timesync* tools are doing most of the >> work there is still a lot of buzz around the automated ntpdate on ifup >> being good/bad for various reasons. >> >> I'll try to to summarize the outcome of multiple discussions and bugs >> around this that I recently passed and propose a solution. > > I think we even need a few more changes around here. > > First of all, we need to change the actual binary for a one-shot time > sync from the long deprecated ntpdate to sntp. > > If we use sntp with the default configuration it uses an unpriviledged > port, which should not race the startup of ntpd anymore. So we could get > rid of all the locking. I've posted a mail regarding this on the mailing > list a couple of months ago. > > https://lists.alioth.debian.org/pipermail/pkg-ntp-maintainers/2017-October/004850.html > > Third, I think a major issue is the package "ntpdate" both shipping the > ntpdate binary (which one might want to use for debugging or because you > just don't know sntp) and the ifup hooks, which simply do not work well > with a lot of use cases. I'm pretty sure that most installations of > ntpdate do not need it. > > I'm therefor proposing a complete rewrite > > - new package sntp-hooks > - depends on sntp, ships hooks for ifupdown and possibly others (like > NetworkManager or systemd-network or whatever Ubuntu is doing now) > - executes the actual sntp synchronisation non-blocking, possibly with > a one-shot systemd unit using --no-block when systemd is running > - make ntpdate depend on sntp-hooks and rm_conffile all installed hooks > > So if you don't want hooks you just don't install sntp-hooks. > > The package sntp-hooks could additionally ship an /etc/default file to > change behaviour. > > I have attempted to spin up some patches for this lately, but ran out of > time. Is this something you could agree on Ubuntu-side?
Hi Bernhard, first of all thanks for your participation and help! Yes - on the isolated view to ntp* I think the proposed changes make sense. Now that we have sntp (back) I think it makes sense to use it instead, but as you already outlined that needs some extra work to behave mostly "like people are used from ntpdate". I like the suggestion to make the hooks an extra package. And yes in Ubuntu (and any system dropping ifup/down down the road I guess) it will be as in [1] "How can I add pre-up, post-up, etc. hook scripts?" Doing that in a new and non enforced package sounds great, for there always will be >0 people who don't want hooks to run. I said "on the isolated view to ntp*" since most of what the ntpdate hooks provided is covered by systemd-timesyncd these days it is also way less important in most usual setups. But OTOH that provides some freedom not being forced to make those new sntp/hooks the total generic swiss army knife. [1]: https://wiki.ubuntu.com/Netplan#Frequently-asked_questions -- Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd

