I was wondering who actually calls /usr/sbin/lightdm-session during the startup proccess. It seems be hard-coded in LightDM somewhere to execute this script when a user log in and a new session is started?

  • I'm somewhat curious what led you to ask this question? – WinEunuuchs2Unix Jun 14 '20 at 21:56
  • @WinEunuuchs2Unix: I'm trying to get a multi-monitor setup to work and want to write down the steps and how the magic works. So far I'm digging though logs of attic documentation and postings with rumors, guessing and stuff that just seem wrong... – Axel Heider Jun 14 '20 at 22:02
  • I have three monitors working without any problems for many years. Maybe you should post a question with the problems you are having and someone can asnwer it. – WinEunuuchs2Unix Jun 14 '20 at 22:51
  • @WinEunuuchs2Unix: it also used to work for me - until recently and then I started wondering why things actually work. So now I want to understand how things work in 2020. And what compatibility layers exists that look at files, but that could also be dropped if setting up things from scratch. – Axel Heider Jun 14 '20 at 23:18

Take a look at /lib/systemd/system/lightdm.service.

  • Thanks. So this starts /usr/sbin/lightdm, but that does not answer my question, Is running /usr/sbin/lightdm-session then hard-coded in lightdm? And I have a new question then also, does lightdm actually read /var/lib/lightdm/.config/monitors.xml or is this another myth? – Axel Heider Jun 15 '20 at 6:15
  • @AxelHeider: You are right; I was too quick there. Please feel free to study the source. :) – Gunnar Hjalmarsson Jun 15 '20 at 12:59

The only place I found where it is called is also commented out so it is no longer called on line 11:

$ cat /usr/lib/lightdm/config-error-dialog.sh

# Copyright (C) 2014 Canonical Ltd
# Author: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 3 of the License.
# See http://www.gnu.org/copyleft/gpl.html the full text of the license.

# This file may be sourced by the function source_with_error_check() in
# /usr/sbin/lightdm-session

export TEXTDOMAIN=lightdm
. /usr/bin/gettext.sh

PARA1=$(eval_gettext 'Error found when loading $CONFIG_FILE:')
PARA2=$(gettext 'As a result the session will not be configured correctly.
You should fix the problem as soon as feasible.')

TEXT="$PARA1\n\n$(fold -s $ERR)\n\n$PARA2"

if [ -x /usr/bin/kdialog ]; then
    TEXT_FILE=$(mktemp --tmpdir config-err-kdialog-XXXXXX)
    echo -n "$TEXT" > "$TEXT_FILE"
    kdialog --textbox "$TEXT_FILE" 500 300
    rm -f "$TEXT_FILE"
elif [ -x /usr/bin/zenity ]; then
    zenity --warning --no-wrap --text="$TEXT"
  • Yes, I found this also when searching my disk. And this left me wondering even more, if this script is used anywhere or not – Axel Heider Jun 14 '20 at 22:05
  • Actually, I's not commented you in this file but it's mentioned there in a comment. It's just the line break that cause it to stand alone on a new line. – Axel Heider Jun 14 '20 at 22:32
  • No that script (which I'm guilty of) may be called from /usr/sbin/lightdm-session, not the other way around. – Gunnar Hjalmarsson Jun 15 '20 at 0:49

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.