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

Debraj Manna subharaj.manna at gmail.com
Tue Apr 2 13:26:14 UTC 2019


Thanks again for all the replies.

I am on Ubuntu 16.04 which is using systemd version 239. It appears to me
that systemd-time-wait-sync.service is not present on this version of
systemd.

I have one more question related to this. If I switch to using systemd's
timesyncd.service then in my service unit file I can use

After=time-sync.target
Wants=time-sync.target

Can someone let me know for how long will the unit wait for ntp sync to
happen before giving up ? Is there a way I can control this?

On Tue, Apr 2, 2019 at 6:51 PM Lennart Poettering <lennart at poettering.net>
wrote:

> On Di, 02.04.19 12:53, Marc Haber (mh+systemd-devel at zugschlus.de) wrote:
>
> > On Tue, Apr 02, 2019 at 12:32:58PM +0200, Lennart Poettering wrote:
> > > I thought people have noticed by now that systemd is really about
> > > removing unnecessary shell scripts from all clean system boot
> > > codepaths.
> >
> > The problem is that millions of professional systems administrators do
> > violently disagree.
>
> Right.
>
> > I have seen unit files full of bash -c and quoting hell. Your work. Be
> > proud of it.
>
> Hmm? if you want to run a shell script from a .service file, you are
> welcome to. Not sure why you would squish a shell script into
> bash -c line. I mean, if you want a shell script, use a shell script,
> there's nothing wrong with that.
>
> Anyway, I think you fundamentally disagree with the approach we took
> of having declarative unit files describing services instead of having
> Turing complete programming languages for everything. At this point
> that discussion is moot, and you are not going to convince us
> anyway. Moreover it's off-topic to this mail list thread, hence please
> let's end this subthread here. Thank you for understanding.
>
> Lennart
>
> --
> Lennart Poettering, Berlin
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20190402/2c6bb3db/attachment.html>


More information about the systemd-devel mailing list