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,862 --session-child 12 19
          └─lxsession,944 -s Lubuntu -e LXDE
              └─lxpanel,1087 --profile Lubuntu
                          └─pstree,26853 -a -p -s 23020
  • 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 applauds Monica Dec 21 '18 at 14:19

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.

  • Not instead, he refers to the same process – 炸鱼薯条德里克 Dec 22 '18 at 4:09
  • What is "the same process"? – Tim Dec 22 '18 at 4:26
  • PID 2852. The text you quoted is saying that lxsession end then PID 2852 do cleaning up. – 炸鱼薯条德里克 Dec 22 '18 at 4:49
  • Thanks. In the example in my post, does the lightdm,862 process call wait() on the lxsession,944 process, and exit when it wakes up from the termination of lxsession,944? – Tim Dec 22 '18 at 4:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.