I just upgrade my desktop from Ubuntu 21.04 to 21.10. Everything works fine! I was happy.
But after that, I run a wrong program that will change the background of the graphical login screen to another picture.
Mostly likely the Script that I run:
I downloaded the following program during 21.04 and install and run it.
github.com/thiggy01/gdm-background
gdm-background/gdm-background-helper /
#!/usr/bin/env python3
import distro
import dbus
import dbus.service
from dbus.mainloop.glib import DBusGMainLoop
from gi.repository import GLib
import shutil
from subprocess import call
class GDMBackground(dbus.service.Object):
if distro.id() == 'ubuntu':
default_theme = '/usr/share/gnome-shell/theme/Yaru/gnome-shell-theme.gresource'
elif distro.id() == 'pop':
default_theme = '/usr/share/gnome-shell/theme/Pop/gnome-shell-theme.gresource'
backup_theme = default_theme + '~'
def __init__(self, conn=None, object_path=None, bus_name=None):
dbus.service.Object.__init__(self, conn, object_path, bus_name)
@dbus.service.method('xyz.thiggy01.GDMBackground', in_signature='s', out_signature='b',
sender_keyword='sender', connection_keyword='conn')
def SetImage(self, task, sender=None, conn=None):
action_id = 'xyz.thiggy01.GDMBackground.SetImage'
if self._check_polkit_privilege(sender, conn, action_id):
if task == 'backup':
shutil.copy(self.default_theme, self.backup_theme)
elif task == 'set':
shutil.move("/tmp/gdm3/theme/gnome-shell-theme.gresource", self.default_theme)
return True
else:
return False
@dbus.service.method('xyz.thiggy01.GDMBackground', in_signature='s', out_signature='b',
sender_keyword='sender', connection_keyword='conn')
def RestoreBackup(self, task, sender=None, conn=None):
action_id = 'xyz.thiggy01.GDMBackground.RestoreBackup'
if self._check_polkit_privilege(sender, conn, action_id):
if task == 'restore':
shutil.move(self.backup_theme, self.default_theme)
return True
else:
return False
@dbus.service.method('xyz.thiggy01.GDMBackground', in_signature='s', out_signature='',
sender_keyword='sender', connection_keyword='conn')
def RestartGDM(self, action_id, sender=None, conn=None):
if self._check_polkit_privilege(sender, conn, action_id):
call(['/usr/sbin/service', 'gdm', 'restart'])
def _check_polkit_privilege(self, sender, conn, action_id):
if sender is None and conn is None:
return
self.proxy_dbus = dbus.Interface(conn.get_object('org.freedesktop.DBus',
'/org/freedesktop/DBus/Bus', False), 'org.freedesktop.DBus')
sender_pid = self.proxy_dbus.GetConnectionUnixProcessID(sender)
self.proxy_polkit = dbus.Interface(dbus.SystemBus().get_object(
'org.freedesktop.PolicyKit1', '/org/freedesktop/PolicyKit1/Authority', False),
'org.freedesktop.PolicyKit1.Authority')
try:
(is_auth, is_challenge, details) = self.proxy_polkit.CheckAuthorization(
('unix-process', {'pid': dbus.UInt32(sender_pid, variant_level=1),
'start-time': dbus.UInt64(0, variant_level=1)}),
action_id, {'':''}, dbus.UInt32(1), 'cancel')
if is_auth:
return True
else:
return False
except dbus.DBusException as error:
self.proxy_polkit.CancelCheckAuthorization('cancel')
raise
if __name__ == '__main__':
DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
name = dbus.service.BusName('xyz.thiggy01.GDMBackground', bus)
gdm_background_helper = GDMBackground(name, '/xyz/thiggy01/GDMBackground')
GLib.MainLoop().run()
After that the Ubuntu 21.10 cannot load the graphical login screen anymore.
There is an error on the screen: Monitor SAD face with the message "Oh no! Something has gone wrong." A problem has occurred and the system can't recover. Please contact a system administrator.
I try troubleshoot the problem by running Ubuntu 21.10 using recovery mode. Then go to the root and using the commands:
sudo apt install ubuntu-gnome-desktop
systemctl status gdm
systemctl start gdm
It doesn't work at all.
I suspect the program / script I run has conflict the set up of GNOME 40 with Ubuntu 21.04. Please help me to get back the original GUI login screen setting.
I try to login to Ubuntu 21.04 using CTRL-SHIFT-F3. Then I type:
systemctl status gdm3
gdm.service is active (running)
Starting GNOME Display Manager.....
But there is an error message:
Gdm: GdmDisplay: Session never registered, failing
Gdm: Child process -2037 was already dead.