On Sun, Mar 10, 2019 at 5:16 PM Tamer Higazi <th9...@googlemail.com> wrote:
>
> I have my gentoo system running with systemd.
>
> I figured out that ntpdate is getting started before network is up.
> I am not yet very familiar with systemd.
>
> Can somebody of you tell me how to fix that, that "ntpdate" is started
> the moment network devices are up ?
>

How is ntpdate being run?  If you're using the supplied unit then it
should default to starting after network-online.target, which if
you're using a network manager started by systemd should delay it
until the network is running.

Now, if you're starting ntpdate in some other way then you'd need to
make sure that the network is online, and if you're starting the
network without using a supplied systemd unit then you'd need to make
sure systemd is aware of when it is up.

Basically, it should just work for the most part if you're using the
supplied units, but you don't mention much about your configuration
and Gentoo users do have a tendency to roll up their sleeves and do
things in scripts/etc.

The output of something like "systemctl status ntpdate" or "journalctl
-ab -u ntpdate" might be helpful.  I'm not sure how you're configuring
your network (networkd, etc)?  That would also be useful to know, as
well as the journal log for the associated units.

Systemd is highly dependency-driven and parallel, so issues like this
are mostly the result of failing to declare a dependency somewhere
(either on the network side or the ntp side).  If you're using openrc
in parallel mode you need to do the same, and again that should be
taken care of out of the box if you're using the supplied services,
but if you roll your own you also have to be careful.

-- 
Rich

Reply via email to