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

Andrei Borzenkov arvidjaar at gmail.com
Fri Jun 12 09:26:35 PDT 2015


В Fri, 12 Jun 2015 16:56:08 +0200
Francis Moreau <francis.moro at gmail.com> пишет:

> 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 ?
> 

Until recently ntpd required working name resolution (i.e. often DNS)
to find its peers. If you mount something over network on boot you want
to have reasonable confidence that network is up.

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

Please explain how filesystem on iSCSI target is supposed to handle
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.
> 

Yes, network-online.target is not there to make boot impossible; it is
there to delay boot until network is considered to be up. It makes
little sense in pure dynamic environment; it is quite useful in static
server environment where network is expected to be always present but
may take some time to be configured.

> > 
> > 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.
> 

Where do you see any deps on NM? network-online.target is generic
target which will be used with any underlying networking implementation.
> 
> IOW, any services having "After: network-online.target" look odd to me.
> 

Welcome to real world :)


More information about the systemd-devel mailing list