[systemd-devel] How to ensure a systemd unit waits for ntpd to sync before starting?

Mantas Mikulėnas grawity at gmail.com
Tue Apr 2 10:01:00 UTC 2019


On Tue, Apr 2, 2019 at 12:33 PM Reindl Harald <h.reindl at thelounge.net>
wrote:

> can you please stop cure replys instead just post to the list breaking
> others threading and reply-list buttons?
>

Can you please stop yelling and ranting at users every day and instead just
post something useful?


>
> Am 02.04.19 um 11:25 schrieb Debraj Manna:
> > I do see a ntp-wait <goog_627709103>.
> > <https://linux.die.net/man/8/ntp-wait> Can some one let me know what
> > corresponding condition I should place in my service unit file to wait
> > for this?
>
> didn't you realize that this isn't even a unit to begin with?
> "Automatically generated by systemd-sysv-generator"
>

If it's a generated unit, it's still a unit.


>
> /etc/init.d/ are never systemd units
>
> in your case i would order a ntpdate between network and ntpd and order
> my service as i showed you after ntpd
>

Unfortunately, ntpdate is soon-to-be-removed
<http://support.ntp.org/bin/view/Dev/DeprecatingNtpdate>, and the official
docs say "use ntpd -g instead".

The website now says, "If you have services that need stable time before
they begin, at this point run ntp-wait, and if it returns "success" it is
safe to start your time-sensitive services."


>
> first get rid of that initscript crap
>
> i doubt that you really want to wait until ntpd say "yeah i am now done
> with my initalization"
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 
Mantas Mikulėnas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190402/169330b6/attachment.html>


More information about the systemd-devel mailing list