Re: [chrony-users] How to Delay Chrony Start Until After PPS Device Attached

[ Thread Index | Date Index | More Archives ]

On Fri, Dec 8, 2023, at 21:59, Joshua Quesenberry wrote:
> Good Evening,
> I'm pulling a 1PPS signal into my system over a USB to Serial device's
> DCD pin; I don't have a typical RS232 port available. In order to fire
> up the PPS line discipline on startup and to create a relably named
> symlink to the created /dev/pps* (of which there are multiple
> generated by PTP also) I'm using a combination of UDEV rules and a
> pps_setup@.service service file. In my chrony.conf I'm giving it an
> entry that looks for the PPS signal at the reliably named symlink (eg.
> /dev/my_pps). The problem I'm running into now is that this device
> isn't ready on startup before Chrony is started and therefore Chrony
> is choking, so my hope is that some of you all have run into a similar

Can you define what you mean by 'ready'? If you mean the relevant /dev/pps* path doesn't yet exist, then you can use 'systemctl edit chrony.service' to add an 'After' dependency on your `pps_setup@<foo>.service`, and systemd will wait to start Chrony until after the other service has been started (and if it's a one-shot service as it probably should be, systemd will actually wait until that service has been *completed*).

If you mean that the /dev/pps* path exists but the device is still not usable, that will be a harder problem to solve, but you could brute-force it by using the same technique above and also adding an ExecStartPost to the pps_setup@<foo>.service override file with something like '/bin/sleep 5'.

To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.

Mail converted by MHonArc 2.6.19+