[systemd-devel] Help needed for optimizing my boot time

Francis Moreau francis.moro at gmail.com
Fri Jun 12 07:56:08 PDT 2015


On 06/11/2015 06:23 PM, Dan Williams wrote:
> On Thu, 2015-06-11 at 15:15 +0200, Francis Moreau wrote:
[...]
>>
>> Does ntpd service really need 'After=network.target', not sure.
> 
> The 'network online' targets are really just there for ignorant services
> that don't respond to network events themselves, that expect the network
> to be up and running before they start.  Of course, those services don't
> have any way to say *which* network interface they care about, so if you
> have more than one interface in your system they still get it wrong.

Do such services exist actually ?

I can't see how such service can work if they can't handle the offline
case properly...

BTW 'network online' target doesn't seem to mean the network is up
because if I boot my computer offline, this target is still reached and
passed.

> 
> But anyway, if ntpd or autofs can respond to network events using
> netlink or listening on D-Bus to NetworkManager/connman/etc or getting
> triggered by eg NetworkManager dispatcher scripts, then they probably
> don't need to block on network-online.  But if they can't, and they
> expect the network to be up and running before they start, then yes they
> will block startup until some kind of networking is running.

Well I must be missing something but I can't see why ntpd or autofs
would rely and have any deps on NM whereas they need to deal with the
generic case, i.e. the one where NM is not installed and used.

In my understanding, they would either use netlink or simply retry later.

I just checked ntpd source code and it seems to use netlink. I can't
find any ntpd script installed in /etc/NetworkManager/dispatcher.d but
ntpd get informed when an network interface is added/removed.

IOW, any services having "After: network-online.target" look odd to me.

Thanks


More information about the systemd-devel mailing list