[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#865382: Possible solution of #865382



Hi,

I've investigated this issue a bit, and it looks like there are actually two things to look at:

  1. Live user doesn't log in automatically.

     This is due to autologin not being configured for SDDM by live-config scripts. In fact, there is no script to 
     configure SDDM at all.

  2. When one enters the password ("live" by default), session startup fails.

     Looks like this is connected to the previous one. As there is no script which configures SDDM, nothing prevents 
     xinit configuration script (/lib/live/config/0140-xinit) from being run, which installs the following snippet to 
     /etc/profile.d/:

        if [ -z "${DISPLAY}" ] && [ $(tty) = /dev/tty1 ]
        then
            while true
            do
                if grep -qs quiet /proc/cmdline
                then
                    startx > /dev/null 2>&1
                else
                    startx
                fi
            done
        fi

     Given that console autologin is enabled by default, this script tries to start the X server in infinite loop. Under 
     certain circumstances this interferes with normal session startup by the display manager, leading to the issue 
     described above.

     Indeed, if one starts the system with "nottyautologin" boot option, the issue vanishes, and it becomes possible to 
     successfully log in after typing the default live user password.

I've attached a patch for live-config which adds SDDM configuration script. It *should* solve both issues. However, 
testing is required.


-- 
Алексей Шилин
diff -aNru live-config-5.20170623.orig/components/0085-sddm live-config-5.20170623/components/0085-sddm
--- live-config-5.20170623.orig/components/0085-sddm	1970-01-01 03:00:00.000000000 +0300
+++ live-config-5.20170623/components/0085-sddm	2017-07-26 11:46:10.443293816 +0300
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+## live-config(7) - System Configuration Components
+## Copyright (C) 2006-2015 Daniel Baumann <mail@daniel-baumann.ch>
+##
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+#set -e
+
+Cmdline ()
+{
+	# Reading kernel command line
+	for _PARAMETER in ${LIVE_CONFIG_CMDLINE}
+	do
+		case "${_PARAMETER}" in
+			live-config.noautologin|noautologin)
+				LIVE_CONFIG_NOAUTOLOGIN="true"
+				;;
+
+			live-config.nox11autologin|nox11autologin)
+				LIVE_CONFIG_NOX11AUTOLOGIN="true"
+				;;
+
+			live-config.username=*|username=*)
+				LIVE_USERNAME="${_PARAMETER#*username=}"
+				;;
+		esac
+	done
+}
+
+Init ()
+{
+	# Disables both console and graphical autologin.
+	case "${LIVE_CONFIG_NOAUTOLOGIN}" in
+		true)
+			exit 0
+			;;
+	esac
+
+	# Disables graphical autologin, no matter what mechanism
+	case "${LIVE_CONFIG_NOX11AUTOLOGIN}" in
+		true)
+			exit 0
+			;;
+	esac
+
+	# Checking if package is installed or already configured
+	if [ ! -e /var/lib/dpkg/info/sddm.list ] || \
+	   [ -e /var/lib/live/config/sddm ]
+	then
+		exit 0
+	fi
+
+	echo -n " sddm"
+}
+
+Config ()
+{
+	# autologin
+	if [ -n "${LIVE_USERNAME}" ]
+	then
+		cat > /etc/sddm.conf << EOF
+[Autologin]
+User=${LIVE_USERNAME}
+Session=plasma.desktop
+EOF
+	fi
+
+	# Avoid xinit
+	touch /var/lib/live/config/xinit
+
+	# Creating state file
+	touch /var/lib/live/config/sddm
+}
+
+Cmdline
+Init
+Config

Reply to: