How to reset/restart lightdm?

Dear mate/lightdm experts,

Ubuntu 22.04
Mate Desktop 1.26.0
LightDM 1.30.0

I have some stability issues (probably hardware related),
and sometimes I would like to restart the login manager (lightdm,
with gtk greeter). I tried to ssh to the machine and run:

sudo systemctl restart lightdm

which sometimes blocks and in the other cases, fails to
restore lightdm to a working state. The equivalent for gdm3
(GNOME display manager) seems to work better.
Is there another way to reset/restart lightdm, as an alternative
to rebooting the system (which would also kill VNC Mate sessions).

Also, are there similar hacks to "Alt+F2 mate-session --replace"
(which is really cool!!) for fixing mate issues?

Many Thanks and Best Regards!
Felix

1 Like

Hi, @fnatter and welcome to the Ubuntu MATE Community!

1 Like

According to LightDM - Ubuntu Wiki lightdm " starts the X servers, user sessions and greeter (login screen)"

Provided that, I am not sure if there is a way to safely restart lightdm without logging out and terminating the current user session.

A possible workaround might be running user session without lightdm. Namely, login through text console and start GUI manually using startx command.

1 Like

hello ugnvs,

thank you for the quick reply. I know that the user session(s)
will be terminated and of course accept that. The point is that
vnc and tmux sessions as well as encrypted containers might
survive this (as was the case with restarting gdm3 years ago).

Many Thanks and Best Regards,
Felix

1 Like

It sounds like your LightDM restart attempts are not always restoring a functional session, which could be due to driver issues, session state corruption, or even a deeper hardware problem. Here are some alternative methods to try:

Alternative Ways to Restart LightDM

  1. Manually Stop & Start LightDM Instead of Restarting
    Try stopping LightDM first and then starting it again:

sudo systemctl stop lightdm
sleep 2
sudo systemctl start lightdm

This ensures that LightDM fully stops before being restarted.

  1. Kill LightDM Processes Manually If LightDM is stuck, try force-killing and then restarting it:

sudo pkill -9 lightdm
sudo systemctl start lightdm

This ensures any zombie processes don't interfere with the restart.

  1. Use xinit to Manually Start the Desktop If LightDM is unresponsive, you can manually start an X session with:

startx /usr/bin/mate-session

This is useful if LightDM itself is the issue but X and Mate are fine.

Fixing MATE Session Issues Without Restarting

  1. Restart the Window Manager (Marco or Compiz) If window decorations or responsiveness are an issue, restart the window manager:

marco --replace &

or

compiz --replace &

  1. Restart the Panel If the MATE panel is frozen or unresponsive:

killall mate-panel
nohup mate-panel &

  1. Restart MATE Components Individually If specific parts of MATE are glitching, restart them:

killall caja && nohup caja & # Restart file manager
killall mate-settings-daemon && nohup mate-settings-daemon & # Reset settings daemon

  1. Full Session Restart Without Logout If the desktop environment is misbehaving but you want to avoid logging out:

mate-session --replace &

(As you already mentioned, this is a great hack!)

Debugging the Issue

Since GDM3 seems more stable, it might be worth testing if switching to GDM3 resolves your issues:

sudo dpkg-reconfigure lightdm

Then select gdm3 as the default display manager.

You might also check logs for clues:

journalctl -xe -u lightdm
dmesg | grep -i error

If the issue is hardware-related (e.g., GPU issues), try switching to modesetting instead of proprietary drivers.

Would you like to explore potential hardware diagnostics as well?

2 Likes

hello Philippe,

many thanks for the extensive and quick reply.

I am admin in a small company, so "startx" or using software rendering is not an option for me.

I will try to kill lightdm instead of using "systemctl stop lightdm".
I will also try to run marco without compositing.

We cannot switch to GDM3 or GNOME3, because it gets confused if users have a physical and a
virtual (vnc) session concurrently.

Regarding hardware issues: We have other issues as well, and try to build new hardware from
scratch now, hoping that we find the root cause now (or just make the problems disappear ;)).

Thanks, Cheers and Best Regards,
Felix

1 Like