5

I wonder how can I check which unit activates another with status indirect?

I run Arch with Gnome and a Debian server. On my Debian machine I can see that output for systemctl list-unit-files --type=target --state=enabled shows, as expected:

default.target enabled multi-user.target enabled 

But on Arch desktop, surprisingly for me, it doesn't, although both: multi-user.target and graphical.target (my default on arch) are active. When I check the status of these units files they are both: indirect. When I list-dependencies for graphical.target it shows gdm.service and multi-user.target. In gdm unit file I do not see Also= in [Install] section. So what exactly activates graphical.target?

What is the reason of this "indirect" solution?

2 Answers 2

1

this is a handy command for those with issues for booting up and may lead you to a solution as why you cant

systemctl list-unit-files

will show you all services and what state there in this next command is more pertinent to the question asked to find the default target

systemctl get-default will show you your default target wonder if this one will get past the censors moderators hey ho probably not ,go out in a blase of glory then

system graphical depends on multi user but multi user does not depend on graphical

this sounds like what is wanted all accolades going to reveiw.org which is well worth checking out, that piece of work hear is the most relevant info concerning it

systemctl list-dependencies --reverse of indirect service

systemed-anyalze dependencies name of indirect service

0

From man systemd.special:

graphical.target
 A special target unit for setting up a graphical login screen. This pulls in multi-user.target. Units that are needed for graphical logins shall add Wants= dependencies for their unit to this unit (or multi-user.target) during installation. This is best configured via WantedBy=graphical.target in the unit's [Install] section. 

So the contents of your gdm.service would explain things more...


Below are the info of those two service on my system, take note of them being "static"...

$ systemctl status multi-user.target graphical.target ● multi-user.target - Multi-User System Loaded: loaded (/lib/systemd/system/multi-user.target; static) Active: active since Mon 2023-09-04 09:34:27 +03; 11h ago Until: Mon 2023-09-04 09:34:27 +03; 11h ago Docs: man:systemd.special(7) Sep 04 09:34:27 kubuntu systemd[1]: Reached target multi-user.target - Multi-User System. ● graphical.target - Graphical Interface Loaded: loaded (/lib/systemd/system/graphical.target; static) Active: active since Mon 2023-09-04 09:34:27 +03; 11h ago Until: Mon 2023-09-04 09:34:27 +03; 11h ago Docs: man:systemd.special(7) Sep 04 09:34:27 kubuntu systemd[1]: Reached target graphical.target - Graphical Interface. 
$ systemctl cat multi-user.target graphical.target # /lib/systemd/system/multi-user.target # SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Multi-User System Documentation=man:systemd.special(7) Requires=basic.target Conflicts=rescue.service rescue.target After=basic.target rescue.service rescue.target AllowIsolate=yes # /lib/systemd/system/graphical.target # SPDX-License-Identifier: LGPL-2.1-or-later # # This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Graphical Interface Documentation=man:systemd.special(7) Requires=multi-user.target Wants=display-manager.service Conflicts=rescue.service rescue.target After=multi-user.target rescue.service rescue.target display-manager.service AllowIsolate=yes 
$ ls -la /lib/systemd/system/{multi-user,graphical}.target -rw-r--r-- 1 root root 606 Jan 26 2023 /lib/systemd/system/graphical.target -rw-r--r-- 1 root root 540 Jan 26 2023 /lib/systemd/system/multi-user.target 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.