#987431 Graphical session or LightDM do not close until unattended-upgrades has applied all updates

Package:
lightdm
Source:
lightdm
Description:
simple display manager
Submitter:
Yvan Masson
Date:
2021-04-26 14:18:32 UTC
Severity:
normal
#987431#5
Date:
2021-04-23 19:20:11 UTC
From:
To:
Dear Maintainer,

I am preparing some Debian 11 desktops (for when it will be the new
stable). The setup is very simple: no root account, one partition, tasks
desktop/Cinnamon/standard tools/SSH. Unattended-upgrades is configured
to install updates on shutdown (see 1): upgrading works properly, but is
very disturbing for the users:

When the user chooses to shutdown or reboot the computer from his
Cinnamon session, the session does not close until all updates are
applied. While waiting:
- icons on the desktop disappear
- the usual menu that allows choosing between
suspend/hibernate/reboot/cancel/shutdown won't appear again (see 2)
- it is still possible to start applications

When a user session has been opened, then closed, and the user clicks on
shutdown or reboot from LightDM, the behavior is similar: LightDM does
not stop. It is even possible to log in again, while unattended-upgrades
is applying updates, but when updates are applied the computer
shutdowns/reboots as requested originally from LightDM.

I would expect the session to be completely closed, LightDM stopped, and
the console or Plymouth displaying a message indicating the ongoing
updates. I am almost sure this has already worked for me in a previous
Debian version or Ubuntu, with the same setup from me.

Please let me know if you need more information or if you want me to do
some tests.

Regards,
Yvan


1. Here are the files I create to configure unattended-upgrades:
$ cat /etc/apt/apt.conf.d/21periodic
   APT::Periodic::Unattended-Upgrade "1";
   APT::Periodic::CleanInterval "1";

$ cat /etc/apt/apt.conf.d/51unattended-upgrades-local
Unattended-Upgrade::Origins-Pattern {
   "origin=Debian,codename=bullseye,label=Debian";
   "origin=Debian,codename=bullseye,label=Debian-Security";
   "origin=Debian,codename=bullseye-updates,label=Debian";
};
Unattended-Upgrade::InstallOnShutdown "true";

$ cat /etc/systemd/logind.conf.d/unattended-upgrades.conf
[Login]
# 30 minutes delay
InhibitDelayMaxSec=1800


2. This matches the following error in ~/.xsession-errors:
Cjs-message: 09:26:35.004: JS LOG: Ignored exception from dbus method:
GIO.IOErrorEnum: GDBus:Error:org.gnome.SessionManager.NotInRunning:
Shutdown interface is only available during the Running phase

#987431#10
Date:
2021-04-26 09:56:44 UTC
From:
To:
Hi Yvan,

The change that took place in unattended-upgrades 1.8:

unattended-upgrades (1.8) unstable; urgency=medium

When InstallOnShutdown was configured unattended-upgrades in
versions before 1.7 installed updates _after_ the shutdown transaction
is started by systemd making maintainer scripts restarting services
fail or wait in a deadlock until being killed by shutdown's timeout
leaving a broken installation behind.

Starting with version 1.7 configuring InstallOnShutdown makes
unattended-upgrades start package installations _before_ the shutdown
transaction is started, when PrepareForShutdown() signal is received
via DBus.

Unattended-upgrades 1.7 also increases logind's InhibitDelayMaxSec to
30 seconds. This allows more time for unattended-upgrades to shut down
gracefully or even install a few packages in InstallOnShutdown mode,
but is still a big step back from the 30 minutes allowed for
InstallOnShutdown previously.

Users enabling InstallOnShutdown mode are advised to increase
InhibitDelayMaxSec even further, possibly to 30 minutes.
--

When shutdown is successfully initiated from a graphical session the
user should be logged out and if the shutdown is successfully
initiated from a login manager it should stop, otherwise any inhibitor
holding up the shutdown can cause the described problems.

Cheers,
Balint

#987431#19
Date:
2021-04-26 10:57:18 UTC
From:
To:
Hi Balint,

Le 26/04/2021 à 11:56, Balint Reczey a écrit :

I just checked again on my simple test VM, the only "shutdown" inhibitor
is Unattended Upgrades Shutdown.

For comparison, I installed Gnome and GDM on this same VM:
- When choosing to shutdown from the Gnome session, the session is
properly closed, but GDM stays on while upgrades are applied. It is even
possible to log in again.
- When I boot, log in, log out and then choosing to shutdown from GDM,
GDM seems to be properly closed: screen becomes all black with only the
blinking "_" on top-left, but `ps` from a SSH session shows that it is
still running.

If I understand properly, all of this means that GDM/LightDM and
Cinnamon do no always react properly to "shutdown" systemd inhibitors:
is my understanding correct?

Do not hesitate to ask if I can help, by testing reporting this elsewhere.

Regards,
Yvan

#987431#24
Date:
2021-04-26 14:14:01 UTC
From:
To:
Hi Yvan,

On Mon, Apr 26, 2021 at 12:57 PM Yvan Masson <yvan@masson-informatique.fr> wrote:

It seems GDM is better, but not perfect yet, then. The re-login
problem is tracked in #608259.

Yes. I've cloned the bug to track it for every package that needs to be fixed.

Thanks, maybe the other packages' maintainers will ask for help with testing.

Cheers,
Balint