Discussion:
How to debug why a unit is started when?
(too old to reply)
Tomasz Torcz 👁️
2018-03-16 15:56:29 UTC
Permalink
Raw Message
On Fri, Mar 16, 2018 at 04:49:28PM +0100, Paul Menzel wrote:
> Dear systemd folks,
>
>
> 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.

Not a direct answer to your question, but you can use systemd-bootchart
to get graphical timeline of how long did it take to start different
units. Then you will have to find box for GDM and see which other
boxes ended at the moment GDM started.

--
Tomasz Torcz Only gods can safely risk perfection,
xmpp: ***@chrome.pl it's a dangerous thing for a man. -- Alia
Andrei Borzenkov
2018-03-16 16:04:44 UTC
Permalink
Raw Message
16.03.2018 18:49, Paul Menzel пишет:
> Dear systemd folks,
>
>
> 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.
Colin Guthrie
2018-03-19 06:31:33 UTC
Permalink
Raw Message
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/
Jérémy Rosen
2018-03-19 08:21:58 UTC
Permalink
Raw Message
systemd-analyze critcal-chain gdm.service  should print the "wait
critical chain" for your unit...i.e why it waited.

does that give you any usefull info ?

On 16/03/2018 16:49, Paul Menzel wrote:
> Dear systemd folks,
>
>
> 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.
>
>
> Kind regards,
>
> Paul
>
>
> [1] https://bugzilla.gnome.org/show_bug.cgi?id=794336
> [2] https://git.gnome.org/browse/gdm/tree/data/gdm.service.in
>
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-***@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel

--
SMILE <http://www.smile.eu/>

20 rue des Jardins
92600 AsniÚres-sur-Seine


*Jérémy ROSEN*
Architecte technique
Responsable de l'expertise Smile-ECS

email ***@smile.fr <mailto:***@smile.fr>
phone +33141402967
url http://www.smile.eu

Twitter <https://twitter.com/GroupeSmile> Facebook
<https://www.facebook.com/smileopensource> LinkedIn
<https://www.linkedin.com/company/smile> Github
<https://github.com/Smile-SA>


Découvrez l’univers Smile, rendez-vous sur smile.eu
<http://smile.eu/?utm_source=signature&utm_medium=email&utm_campaign=signature>

eco Pour la planÚte, n'imprimez ce mail que si c'est nécessaire
Loading...