当使用 LightDM 时,谁调用 /usr/sbin/lightdm-session

当使用 LightDM 时,谁调用 /usr/sbin/lightdm-session

我想知道在启动过程中究竟是谁调用了 /usr/sbin/lightdm-session。似乎 LightDM 中某个地方有硬编码,当用户登录并启动新会话时执行此脚本?

答案1

看一眼/lib/systemd/system/lightdm.service

答案2

我发现唯一调用它的地方也被注释掉了,所以它在第 11 行不再被调用:

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

# Copyright (C) 2014 Canonical Ltd
# Author: Gunnar Hjalmarsson <[email protected]>
#
# 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"
fi

答案3

lightdm.service对用户进行身份验证时,将启动并session-wrapper执行新的会话。您可以在/etc/lightdm/lightdm.conf或默认:lightdm-session被执行。

相关内容