To do this right for the systemd wrapper is harder.
We could go with ExecStartPre / ExecStopPost or code it into the systemd wrapper.
The pre/post solution is "more different" from what we had before in sysv, also I didn't find any other good examples f extra locks in systemd services to build upon - so stick with the change systemd wrapper.
With experimental changes I checked:
- sudo flock --timeout 5 /run/lock/ntpdate sleep 20 will hold the daemon start correctly until out of the way.
- I also see a correct error message now if that happens to time out.
- After the service started the lock is free it seems.
But that isn't a problem the hook "can fail" without breaking anything - in case it is
configured very differently it might even work.
TL;DR - ntp would be protected from ntpdate, but vice versa that should not be needed.
Note - the old timeout that was used was 180 seconds, I keep that.
To do this right for the systemd wrapper is harder.
We could go with ExecStartPre / ExecStopPost or code it into the systemd wrapper.
The pre/post solution is "more different" from what we had before in sysv, also I didn't find any other good examples f extra locks in systemd services to build upon - so stick with the change systemd wrapper.
With experimental changes I checked:
- sudo flock --timeout 5 /run/lock/ntpdate sleep 20 will hold the daemon start correctly until out of the way.
- I also see a correct error message now if that happens to time out.
- After the service started the lock is free it seems.
But that isn't a problem the hook "can fail" without breaking anything - in case it is
configured very differently it might even work.
TL;DR - ntp would be protected from ntpdate, but vice versa that should not be needed.
Note - the old timeout that was used was 180 seconds, I keep that.