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

Francis Moreau francis.moro at gmail.com
Thu Jun 11 05:10:17 PDT 2015


On 06/11/2015 01:40 PM, Andrei Borzenkov wrote:
> On Thu, Jun 11, 2015 at 2:26 PM, Francis Moreau <francis.moro at gmail.com> wrote:
>>>>
>>>>    $ systemd-analyze critical-chain
>>>>
>>>>    graphical.target @7.921s
>>>>      multi-user.target @7.921s
>>>>        autofs.service @7.787s +132ms
>>>>          network-online.target @7.786s
>>>>            network.target @7.786s
>>>>              NetworkManager.service @675ms +184ms
>>>>                basic.target @674ms
>>>>                  ...
>>>>
> ...
>>> Is NetworkManager-wait-online.service enabled and active?
>>>
>>
>> It seems it's enabled but no more active:
>>
>> $ systemctl status NetworkManager-wait-online.service
>> ● NetworkManager-wait-online.service - Network Manager Wait Online
>>    Loaded: loaded
>> (/usr/lib/systemd/system/NetworkManager-wait-online.service; disabled;
>> vendor preset: disabled)
>>    Active: inactive (dead) since Thu 2015-06-11 11:54:37 CEST; 1h 4min ago
>>   Process: 583 ExecStart=/usr/bin/nm-online -s -q --timeout=30
>> (code=exited, status=0/SUCCESS)
>>  Main PID: 583 (code=exited, status=0/SUCCESS)
>>
>> Jun 11 11:54:30 cyclone systemd[1]: Starting Network Manager Wait Online...
>> Jun 11 11:54:37 cyclone systemd[1]: Started Network Manager Wait Online.
>>
>> This seems correct to me, doesn't it ?
>>
> 
> Actually it says "disabled" which makes me wonder why it run. But this
> is the service that is likely responsible for long time you observe.

I think it runs because of this:

$ ls /usr/lib/systemd/system/network-online.target.wants/
NetworkManager-wait-online.service

BTW, why isn't it showed by 'systemd-analyze critical-chain' ?

> If disabling it does ot help, you can try masking it (systemctl mask)
> for a test.

Actually, I'm still not sure why autofs.service is waiting for
network-online.target to be activated, IOW why this service has
'After=network-online.target'.

> 
> OTOH "disabled" here just means links in [Install] section are not
> present.

   $ cat /usr/lib/systemd/system/NetworkManager-wait-online.service
     ...
     [Install]
     WantedBy=multi-user.target

and I can't find the corresponding symlink in
/usr/lib/systemd/system/multi-user.target.wants/ or
/etc/systemd/system/multi-user.target.wants/

So you seem right, and "disabled" seems a bit mis-leading here.

> Could you show
> sysmectl show NetworkManager-wait-online.service -p WantedBy -p RequiredBy
> 

$ systemctl show NetworkManager-wait-online.service -p WantedBy -p
RequiredBy
RequiredBy=
WantedBy=network-online.target

Thanks


More information about the systemd-devel mailing list