Skip to content

chrony: Hotplug race condition #28434

@wagnerflo

Description

@wagnerflo

Package Name

chrony

Maintainer

@mlichvar

OpenWrt Version

24.10.4

OpenWrt Target/Subtarget

lantiq/xrx200

Steps to Reproduce

  1. Start the device
  2. Check if the hotplug.ntp event has been recieved through udev. For example by placing a script in /etc/hotplug.d/ntp to log something.

Actual Behaviour

chrony's init script starts chronyd as well as /usr/sbin/chrony-hotplug in short succession (through procd). The latter then proceeds to immediately call /usr/bin/chronyc waitsync .... On my device (Fritzbox 7490; but I'd assume this is bound to happen on any not-so-fast hardware) the chronyd process doesn't come up fast enough most of the times. So chronyc will fail with "Could not open connection to daemon" and the stratum notification event never get's sent.

This for example breaks the DNSSEC after NTP for unbound.

I fixed it locally with a sleep 10 at the top of /usr/sbin/chrony-hotplug but that obviously is just a hack and no guarantee whatsoever.

Confirmation Checklist

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions