-2

What does lightdm --session-child 12 19 mean in the following output?

Why does lightdm fork a process to execute the above command?

I don't find --session-child in lightdm manpage. Thanks.

$ pstree -a -p   -s $$
systemd,1 --system --deserialize 19
  └─lightdm,661
      └─lightdm,862 --session-child 12 19
          └─lxsession,944 -s Lubuntu -e LXDE
              └─lxpanel,1087 --profile Lubuntu
                  └─lxterminal,23017
                      └─bash,23020
                          └─pstree,26853 -a -p -s 23020
Tim
  • 101,790
  • 3
    Hello! Have you tried googling "lightdm --session-child"? Some of the results from the first page, this topic in particular, should answer your questions. Generally, many pieces of software have undocumented keys that control some of their inner workings. Such keys are meant to be used only be people working on the project and not ordinary users. – undercat Dec 21 '18 at 14:19

1 Answers1

1

From https://lists.freedesktop.org/archives/lightdm/2015-December/000916.html

> ps aux | grep lightdm | grep -v grep
>
> is
>
> root       894  0.0  0.1  35192  3492 ?        SLsl 22:19   0:00 lightdm
> root      2766  1.9  1.3  98744 26980 tty7     Ssl+ 22:49   0:45
> /usr/bin/X -core :0 -seat seat0 -auth /var/run/lightdm/root/:0
> -nolisten tcp vt7 -novtswitch
> root      2852  0.0  0.1  19876  3796 ?        Sl   22:49   0:00
> lightdm --session-child 12 19

Yes, it is normal to have two processes.

The first lightdm process is the daemon (PID 894). When you log in, PAM requires that we start a child process to run the PAM functions inside. LightDM does this by setting up some pipes to communicate with the daemon and then re-running itself with --session-child (PID 2852). PAM then (as root) does whatever it is configured for to authenticate the user and set up this process to be suitable as your session. Once that is complete we fork another process, drop permissions and actually run your session. We need to keep the session child open so when your session ends, we can run the cleanup process with PAM.

I guess "the session child" in the last sentence means the second lightdm process, instead of a lxsession process. But I don't really know the source code.

Tim
  • 101,790