Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] start ntpdate after network....
Date: Sun, 10 Mar 2019 21:37:10
Message-Id: CAGfcS_mutp-hODjwHYKJ9QKnr0XzFiMdqHB45kyVrYiVJdvQYA@mail.gmail.com
In Reply to: [gentoo-user] start ntpdate after network.... by Tamer Higazi
1 On Sun, Mar 10, 2019 at 5:16 PM Tamer Higazi <th982a@××××××××××.com> wrote:
2 >
3 > I have my gentoo system running with systemd.
4 >
5 > I figured out that ntpdate is getting started before network is up.
6 > I am not yet very familiar with systemd.
7 >
8 > Can somebody of you tell me how to fix that, that "ntpdate" is started
9 > the moment network devices are up ?
10 >
11
12 How is ntpdate being run? If you're using the supplied unit then it
13 should default to starting after network-online.target, which if
14 you're using a network manager started by systemd should delay it
15 until the network is running.
16
17 Now, if you're starting ntpdate in some other way then you'd need to
18 make sure that the network is online, and if you're starting the
19 network without using a supplied systemd unit then you'd need to make
20 sure systemd is aware of when it is up.
21
22 Basically, it should just work for the most part if you're using the
23 supplied units, but you don't mention much about your configuration
24 and Gentoo users do have a tendency to roll up their sleeves and do
25 things in scripts/etc.
26
27 The output of something like "systemctl status ntpdate" or "journalctl
28 -ab -u ntpdate" might be helpful. I'm not sure how you're configuring
29 your network (networkd, etc)? That would also be useful to know, as
30 well as the journal log for the associated units.
31
32 Systemd is highly dependency-driven and parallel, so issues like this
33 are mostly the result of failing to declare a dependency somewhere
34 (either on the network side or the ntp side). If you're using openrc
35 in parallel mode you need to do the same, and again that should be
36 taken care of out of the box if you're using the supplied services,
37 but if you roll your own you also have to be careful.
38
39 --
40 Rich

Replies

Subject Author
Re: [gentoo-user] start ntpdate after network.... Tamer Higazi <th982a@××××××××××.com>