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

2021-04-26 Thread Balint Reczey
Control: found -1 1.26.0-7
Control: clone -1 -2
Control: reassign -2 cinnamon 4.8.6-2
Control: retitle -2 Cinnamon does not close session when shutdown starts

Hi Yvan,

On Mon, Apr 26, 2021 at 12:57 PM Yvan Masson
 wrote:
>
> Hi Balint,
>
> Le 26/04/2021 à 11:56, Balint Reczey a écrit :
> > Control: reassign -1 lightdm
> >
> > Hi Yvan,
> >
> > On Fri, Apr 23, 2021 at 9:21 PM Yvan Masson  
> > wrote:
> >>
> >> Package: unattended-upgrades
> >> Version: 2.8
> >> Severity: normal
> >>
> >> 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.
> >
> > 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.
>
> Thanks for the detailed answer.
>
> 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.

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

> 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?

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

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

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

Cheers,
Balint

--
Balint Reczey
Ubuntu & Debian Developer



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

2021-04-26 Thread Yvan Masson

Hi Balint,

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

Control: reassign -1 lightdm

Hi Yvan,

On Fri, Apr 23, 2021 at 9:21 PM Yvan Masson  wrote:


Package: unattended-upgrades
Version: 2.8
Severity: normal

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.


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.


Thanks for the detailed answer.

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


Cheers,
Balint





OpenPGP_signature
Description: OpenPGP digital signature


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

2021-04-26 Thread Balint Reczey
Control: reassign -1 lightdm

Hi Yvan,

On Fri, Apr 23, 2021 at 9:21 PM Yvan Masson  wrote:
>
> Package: unattended-upgrades
> Version: 2.8
> Severity: normal
>
> 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.

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

-- 
Balint Reczey
Ubuntu & Debian Developer



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

2021-04-23 Thread Yvan Masson

Package: unattended-upgrades
Version: 2.8
Severity: normal

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



-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-6-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_WARN
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE 
not set

Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages unattended-upgrades depends on:
ii  debconf [debconf-2.0]  1.5.75
ii  lsb-base   11.1.0
ii  lsb-release11.1.0
ii  python33.9.2-2
ii  python3-apt2.1.7
ii  python3-dbus   1.2.16-5
ii  python3-distro-info1.0
ii  ucf3.0043
ii  xz-utils   5.2.5-2

Versions of packages unattended-upgrades recommends:
ii  anacron 2.3-30
ii  cron [cron-daemon]  3.0pl1-137
ii  systemd-sysv247.3-3

Versions of packages unattended-upgrades suggests:
pn  bsd-mailx  
ii  exim4-daemon-light [mail-transport-agent]  4.94-17
ii  needrestart3.5-2
ii  powermgmt-base 1.36
ii  python3-gi 3.38.0-2

-- debconf information excluded



OpenPGP_signature
Description: OpenPGP digital signature