Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Live Build: Custom dconf defaults + gnome-screensaver getting stuck at boot

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
dtrunk90
Posts: 3
Joined: 2024-03-27 17:16

Live Build: Custom dconf defaults + gnome-screensaver getting stuck at boot

#1 Post by dtrunk90 »

Hello all,

I'm about to build a custom Debian with Budgie and some other stuff pre-installed.
Now I'm facing one issue:
After setting custom dconf defaults like described here booting the live system gets stuck at the systemd service live-config.service.
I've used this commit as a reference.

The problem is inside /lib/live/config/1040-gnome-screensaver (part of the package live-config) where it gets stuck at line 44 (dbus-run-session command):

Code: Select all

#!/bin/sh

. /lib/live/config.sh

## live-config(7) - System Configuration Components
## Copyright (C) 2016-2020 The Debian Live team
## 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.username=*|username=*)
				LIVE_USERNAME="${_PARAMETER#*username=}"
				;;
		esac
	done
}

Init ()
{
	# Checking if package is installed or already configured
	if ! pkg_is_installed "gnome-screensaver" || \
	   component_was_executed "gnome-screensaver"
	then
		exit 0
	fi

	echo -n " gnome-screensaver"
}

Config ()
{
	# Disabling to lock the screen when the screensaver goes active.
	#sudo -u "${LIVE_USERNAME}" dbus-run-session -- gsettings set org.gnome.desktop.screensaver lock-enabled false

	# Creating state file
	touch /var/lib/live/config/gnome-screensaver
}

Cmdline
Init
Config
This issue only happens with those custom dconf defaults/profile. Without includes.chroot/etc/dconf the issue is gone.
As you can see I've commented out that line and placed it in includes.chroot/lib/live/config/1040-gnome-screensaver to overwrite the file provided by that package to see if it boots fine then.
Since it does I know that something's wrong with that command not exiting at all.

I also have the same hook like here.

So, now I know where the issue is coming from but I don't know the reason and also not how to solve it properly.

Best regards,
Danny.

Aki
Global Moderator
Global Moderator
Posts: 2979
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 75 times
Been thanked: 407 times

Re: Live Build: Custom dconf defaults + gnome-screensaver getting stuck at boot

#2 Post by Aki »

Hello,
dtrunk90 wrote: 2024-03-27 17:42 As you can see I've commented out that line and placed it in includes.chroot/lib/live/config/1040-gnome-screensaver to overwrite the file provided by that package to see if it boots fine then.
Just a wild guess.

I don't know exactly when the script you named "/lib/live/config/1040-gnome-screensaver" is executed. But if it is run after starting Debian Live, this is the output of the command:

Code: Select all

$ sudo -u "${LIVE_USERNAME}" dbus-run-session -- gsettings set org.gnome.desktop.screensaver lock-enabled false
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABkNnS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABkNnS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command [arg ...]]
usage: sudo [-ABbEHkNnPS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T
            timeout] [-u user] [VAR=value] [-i | -s] [command [arg ...]]
usage: sudo -e [-ABkNnS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T
            timeout] [-u user] file ...
            
user@debian:~$ echo $LIVE_USERNAME
As you can see, this does not work in the normal Debian live shell, because the shell variable LIVE_USERNAME is not defined.

You can try replacing it with (since in Debian the live user is "user"), i.e.:

Code: Select all

$ sudo -u user dbus-run-session -- gsettings set org.gnome.desktop.screensaver lock-enabled false
dbus-daemon[3304]: [session uid=1000 pid=3304] Activating service name='ca.desrt.dconf' requested by ':1.0' (uid=1000 pid=3305 comm="gsettings set org.gnome.desktop.screensaver lock-e")
dbus-daemon[3304]: [session uid=1000 pid=3304] Successfully activated service 'ca.desrt.dconf'
Hope this helps.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

dtrunk90
Posts: 3
Joined: 2024-03-27 17:16

Re: Live Build: Custom dconf defaults + gnome-screensaver getting stuck at boot

#3 Post by dtrunk90 »

Aki wrote: 2024-04-01 11:41 Just a wild guess.

I don't know exactly when the script you named "/lib/live/config/1040-gnome-screensaver" is executed. But if it is run after starting Debian Live, this is the output of the command:

Code: Select all

$ sudo -u "${LIVE_USERNAME}" dbus-run-session -- gsettings set org.gnome.desktop.screensaver lock-enabled false
usage: sudo -h | -K | -k | -V
usage: sudo -v [-ABkNnS] [-g group] [-h host] [-p prompt] [-u user]
usage: sudo -l [-ABkNnS] [-g group] [-h host] [-p prompt] [-U user] [-u user] [command [arg ...]]
usage: sudo [-ABbEHkNnPS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T
            timeout] [-u user] [VAR=value] [-i | -s] [command [arg ...]]
usage: sudo -e [-ABkNnS] [-r role] [-t type] [-C num] [-D directory] [-g group] [-h host] [-p prompt] [-R directory] [-T
            timeout] [-u user] file ...
            
user@debian:~$ echo $LIVE_USERNAME
As you can see, this does not work in the normal Debian live shell, because the shell variable LIVE_USERNAME is not defined.

You can try replacing it with (since in Debian the live user is "user"), i.e.:

Code: Select all

$ sudo -u user dbus-run-session -- gsettings set org.gnome.desktop.screensaver lock-enabled false
dbus-daemon[3304]: [session uid=1000 pid=3304] Activating service name='ca.desrt.dconf' requested by ':1.0' (uid=1000 pid=3305 comm="gsettings set org.gnome.desktop.screensaver lock-e")
dbus-daemon[3304]: [session uid=1000 pid=3304] Successfully activated service 'ca.desrt.dconf'
Hope this helps.
That script is part of the package live-config. It's not my script. I just copied it into my build config to overwrite it and commented out the problematic command just for debugging purposes.

dtrunk90
Posts: 3
Joined: 2024-03-27 17:16

Re: Live Build: Custom dconf defaults + gnome-screensaver getting stuck at boot

#4 Post by dtrunk90 »

I've now changed the Config function to do this:

Code: Select all

Config ()
{
	sudo -u "${LIVE_USERNAME}" dbus-run-session -- gsettings get org.gnome.desktop.screensaver lock-enabled > /var/lib/live/config/gnome-screensaver
	sudo -u "${LIVE_USERNAME}" dbus-run-session -- gsettings set org.gnome.desktop.screensaver lock-enabled false >> /var/lib/live/config/gnome-screensaver
	# Disabling to lock the screen when the screensaver goes active.
	#sudo -u "${LIVE_USERNAME}" dbus-run-session -- gsettings set org.gnome.desktop.screensaver lock-enabled false

	# Creating state file
	#touch /var/lib/live/config/gnome-screensaver
}
But all I can see in /var/lib/live/config/gnome-screensaver is "true". The second command doesn't return an exit value and runs endlessly without any output (neither stdout nor stderr).
I don't know how to get any information why the gsettings set command doesn't exit at all.
It must have something to do with my custom dconf profile.

Post Reply