[systemd-devel] How to debug why a unit is started when?
Colin Guthrie
colin at mageia.org
Mon Mar 19 06:31:33 UTC 2018
Paul Menzel wrote on 17/03/18 17:50:
> Dear Andrei,
>
>
> On 03/16/2018 05:04 PM, Andrei Borzenkov wrote:
>> 16.03.2018 18:49, Paul Menzel пишет:
>
>>> I am trying to get the GDM login screen started earlier on a Dell XPS 13
>>> 9370 with Debian Sid/unstable system with systemd 238. Currently, after
>>> selecting the Linux kernel in GRUB it’s only displayed after roughly
>>> eight to ten seconds while Linux takes around two seconds [1].
>>>
>>> Using systemd-bootchart I see that GDM is started quite late [1], and I
>>> wondering if there is an option to find out why.
>>>
>>> GDM’s service unit [2] has the “dependencies” below.
>>>
>>> After=rc-local.service plymouth-start.service
>>> systemd-user-sessions.service
>>>
>>> Is there a debug option, where systemd says, why a certain unit is
>>> started? For example, reached target X and therefore starting Y.
>>
>> systemctl --after (--recursive) --list-dependencies gdm.service
>>
>> may be the first step. Or use systemd-analyze chart to see full picture
>> of what was started when.
>
> I didn’t know about `systemd-analyze plot`. Please find the SVG file
> attached.
>
> Looking at the log messages, I kind of think it’s related to the
> NetworkManager, but I do not see the dependency. Is it
> `rc-local.service`? It seems to depend on the `network.target`.
I didn't look too hard at the data, but from experience,
systemd-user-sessions often has to start after the network is online as
user accounts may be defined in e.g. LDAP etc.
This is the likely chain you need to break and configure accordingly.
e.g. if you have no network filesystems (defined without noauto or
nofail) and no LDAP/NIS users etc., then you may not need
networkmanager-wait-online.service and if you disable this, things might
go a lot faster.
Be careful however, as some old network-listening services may still
need this dodgy delay service to function properly.
HTHs
Col
--
Colin Guthrie
colin(at)mageia.org
http://colin.guthr.ie/
Day Job:
Tribalogic Limited http://www.tribalogic.net/
Open Source:
Mageia Contributor http://www.mageia.org/
PulseAudio Hacker http://www.pulseaudio.org/
Trac Hacker http://trac.edgewall.org/
More information about the systemd-devel
mailing list