Your message dated Sun, 28 Sep 2014 21:22:04 +0000
with message-id <e1xyluu-0005mg...@franck.debian.org>
and subject line Bug#762218: fixed in lightdm 1.10.2-2
has caused the Debian Bug report #762218,
regarding lightdm: maintainer scripts not idempotent: reinstalling does not fix 
half-working package
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
762218: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=762218
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: lightdm
Version: 1.10.2-1
Severity: serious

On a system where lightdm is installed, then purged and then
reinstalled again, the /var/lib/lightdm directory *might* not exist,
leading to a system where lightdm does not start and the user is
*greatly* confused.

In my case, these are the symptoms:

# systemctl status lightdm
lightdm.service - Light Display Manager
   Loaded: loaded (/lib/systemd/system/lightdm.service; enabled)
   Active: failed (Result: start-limit) since vie 2014-09-19 18:40:41 CEST; 
25min ago
     Docs: man:lightdm(1)
  Process: 1933 ExecStart=/usr/sbin/lightdm (code=exited, status=1/FAILURE)
  Process: 1930 ExecStartPre=/bin/sh -c [ "$(cat 
/etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/lightdm" ] 
(code=exited, status=0/SUCCESS)
 Main PID: 1933 (code=exited, status=1/FAILURE)
   CGroup: /system.slice/lightdm.service

sep 19 18:40:41 mymachine systemd[1]: lightdm.service: main process exited, 
code=exited, status=1/FAILURE
sep 19 18:40:41 mymachine systemd[1]: Unit lightdm.service entered failed state.
sep 19 18:40:41 mymachine systemd[1]: lightdm.service holdoff time over, 
scheduling restart.
sep 19 18:40:41 mymachine systemd[1]: Stopping Light Display Manager...
sep 19 18:40:41 mymachine systemd[1]: Starting Light Display Manager...
sep 19 18:40:41 mymachine systemd[1]: lightdm.service start request repeated 
too quickly, refusing to start.
sep 19 18:40:41 mymachine systemd[1]: Failed to start Light Display Manager.
sep 19 18:40:41 mymachine systemd[1]: Unit lightdm.service entered failed state.

After investigation, it seems the root of the problem is that /var/lib/lightdm
did not exist. But before I discovered that, one might thing that

dpkg --purge lightdm
apt-get install lightdm

would fix the problem.

Well, it does not because the /var/lib/lightdm directory is created
*only* if the lightdm user does not exist:

# creating lightdm user if he isn't already there
if ! getent passwd lightdm >/dev/null; then
        adduser --system --ingroup lightdm --home /var/lib/lightdm lightdm
        usermod -c "Light Display Manager" lightdm
        usermod -d "/var/lib/lightdm"      lightdm
        usermod -g "lightdm"               lightdm
        usermod -s "/bin/false"            lightdm
fi

# The following code does only work if /var/lib/lightdm *already* exist:
if [ -d /var/lib/lightdm ]; then
  chown -R lightdm:lightdm /var/lib/lightdm
  chmod 0750 /var/lib/lightdm
fi


So this is how you can reproduce the disaster I have just experienced:

* Take a jessie system with minimal packages installed.

* Install lightdm:

apt-get install lightdm

* Do something that makes the purge not to work 100% as expected, like, for 
example

rm /usr/sbin/deluser

In my case, I believe having lightdm still working is what actually
happened for deluser to fail.

* Purge lightdm:

dpkg --purge lightdm

What postrm does (or does not do) is part of the problem. let's see:

if [ "$1" = "purge" ] ; then
        update-rc.d lightdm remove >/dev/null
        if [ -d /var/lib/lightdm ]; then
                rm -r /var/lib/lightdm
        fi
# Ok, we see here that /var/lib/lightdm is removed *unconditionally*.

        if [ -d /var/log/lightdm ]; then
                rm -r /var/log/lightdm
        fi
        if getent passwd lightdm >/dev/null; then
                if [ -x /usr/sbin/deluser ]; then
                        deluser --system lightdm ||echo " Could not remove 
lightdm user, please make sure lightdm is not running before attempting to 
purge lightdm" 
                fi
        fi
# But if deluser fails, for whatever reason, postrm still ends with an exit 
status of 0
# and the lightdm user will already exist if the user decides to reinstall 
lightdm.


So, it seems that postinst and postrm do not play by the same rules,
because postinst blindly assumes that this implication holds:

user lightdm exists   ==>   the directory /var/lib/lightdm does not need to be 
created

while, at the same time, postrm makes such assumption not to be true,
as it unconditionally removes /var/lib/lightdm and then forgives any
error from deluser.

Proposals:

1) In postinst, please add code to ensure that /var/lib/lightdm exist
*regardless* of the user lightdm already existing or not.

2) In postrm, please do not ignore error from deluser. Quoting policy:

  The package management system looks at the exit status from these
  scripts. It is important that they exit with a non-zero status if
  there is an error, so that the package management system can stop its
  processing.

3) In postrm, please change the order in which things are done: If
deluser does not work because I'm still using lightdm, there is no
point in removing /var/lib/lightdm because then it is when things
start to go really wrong. In fact, postrm should abort the purge as
soon as possible if lightdm is still working in the system.

Either I can purge the package or I can't, but if I purge it and the
postm script "forgives" some of the errors, the system should not be
left with a lightdm package which appears as being "installed" but
does not work.

Thanks.

--- End Message ---
--- Begin Message ---
Source: lightdm
Source-Version: 1.10.2-2

We believe that the bug you reported is fixed in the latest version of
lightdm, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 762...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Yves-Alexis Perez <cor...@debian.org> (supplier of updated lightdm package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Sun, 28 Sep 2014 21:58:17 +0200
Source: lightdm
Binary: lightdm lightdm-vala liblightdm-gobject-1-0 liblightdm-qt-3-0 
liblightdm-gobject-dev liblightdm-qt-dev gir1.2-lightdm-1
Architecture: source amd64
Version: 1.10.2-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Xfce Maintainers <pkg-xfce-de...@lists.alioth.debian.org>
Changed-By: Yves-Alexis Perez <cor...@debian.org>
Description:
 gir1.2-lightdm-1 - Typelib file for liblightdm-1
 liblightdm-gobject-1-0 - simple display manager (gobject library)
 liblightdm-gobject-dev - simple display manager (gobject development files)
 liblightdm-qt-3-0 - simple display manager (Qt library)
 liblightdm-qt-dev - simple display manager (Qt development files)
 lightdm    - simple display manager
 lightdm-vala - simple display manager (Vala files)
Closes: 683508 762218 763187
Changes:
 lightdm (1.10.2-2) unstable; urgency=medium
 .
   * debian/patches:
     - 05_debianize-pam-files edited, don't log an error if
     libpam-gnome-keyring is not installed.                      closes: #683508
   * debian/control:
     - put lipam-systemd before consolekit in alternative.       closes: #763187
   * debian/lightdm.postinst:
     - make sure /var/lib/lightdm always exists.                 closes: #762218
Checksums-Sha1:
 55271a32474a07ba410802a7078d73208a4f8393 2393 lightdm_1.10.2-2.dsc
 88b0539cc3c0217bd62185318c6af9978598a61f 32956 lightdm_1.10.2-2.debian.tar.xz
 e6e43e9da8ef701546caa939aa035c01a37f21fc 154482 lightdm_1.10.2-2_amd64.deb
 d52f121689d8103495166080e99dfb16e9eec637 21094 lightdm-vala_1.10.2-2_amd64.deb
 e82b9f74c972f3696f31baa05d3ce15d0f67b46f 49952 
liblightdm-gobject-1-0_1.10.2-2_amd64.deb
 b6098006a6cc4b7b0a6db1b34490c800197baaff 49866 
liblightdm-qt-3-0_1.10.2-2_amd64.deb
 d043ae642d557bc9129350098ddef5b81aaab5b3 75142 
liblightdm-gobject-dev_1.10.2-2_amd64.deb
 21c5961b7f6d4a011b3a75fc0c7c52fef9d44a3a 50152 
liblightdm-qt-dev_1.10.2-2_amd64.deb
 3d44fd4af86a84cb9ad6bcd12b392a97ffa93d2b 23008 
gir1.2-lightdm-1_1.10.2-2_amd64.deb
Checksums-Sha256:
 49a4e128824ff467d1baa0ebd39519f5d36e27cc4800fe5a3288c030640fd351 2393 
lightdm_1.10.2-2.dsc
 d7029fac2497a8fb0c8860165c748a0b103528496d48e5efb9cbe94ca1167153 32956 
lightdm_1.10.2-2.debian.tar.xz
 cff4fc06dcae863fe888dcbda43d982ff18f203df7fb50588885faecbac26ea4 154482 
lightdm_1.10.2-2_amd64.deb
 86d2b3459072cafbdc77687ab89ba6531b39afa8229b2857e7d1836ae8e1ffae 21094 
lightdm-vala_1.10.2-2_amd64.deb
 e319cfe3d8c36215bbd6fb1f53e94b61b10b43fd00d5601a1adb81fb9822c459 49952 
liblightdm-gobject-1-0_1.10.2-2_amd64.deb
 38a7f53e6f0a1d0e09df01363e2ac315293002a2b531b333ffdf14fb6538fe7e 49866 
liblightdm-qt-3-0_1.10.2-2_amd64.deb
 52745195a91ebe9ba2e8d0d2cf5c2cd6a1da7c4cb1c6bdf17ad7ce4703fc7e5f 75142 
liblightdm-gobject-dev_1.10.2-2_amd64.deb
 db3cf473c9a053e065cd44116cd1df422afc4fd6f8ff4e63f082af97b578fa57 50152 
liblightdm-qt-dev_1.10.2-2_amd64.deb
 0fb555d92ac01f17764eb110abc60816142423b1800d105b968cecc3135fc9c1 23008 
gir1.2-lightdm-1_1.10.2-2_amd64.deb
Files:
 6c4d43786cf6ea7fb3369305d3ba6eaa 154482 x11 optional lightdm_1.10.2-2_amd64.deb
 91eb5064b24a6c0e04a3c60653335614 21094 x11 optional 
lightdm-vala_1.10.2-2_amd64.deb
 886a1dbc32d6890c547e838e70409166 49952 libdevel optional 
liblightdm-gobject-1-0_1.10.2-2_amd64.deb
 1cd1940189877ab4e13234c0759a3a8d 49866 libdevel optional 
liblightdm-qt-3-0_1.10.2-2_amd64.deb
 2fc51492f537de2f7796ea1a2899ed79 75142 libdevel optional 
liblightdm-gobject-dev_1.10.2-2_amd64.deb
 13d57cf02065ace0542bf4131eee7a71 50152 libdevel optional 
liblightdm-qt-dev_1.10.2-2_amd64.deb
 4072d9013d39a4298fcb8d56fba9e932 23008 libs optional 
gir1.2-lightdm-1_1.10.2-2_amd64.deb
 c7c1af752d45010bfa58ce2d80961de7 2393 x11 optional lightdm_1.10.2-2.dsc
 d386c6a15b61ce1d4aa6bac27c1714c1 32956 x11 optional 
lightdm_1.10.2-2.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCgAGBQJUKGmFAAoJEG3bU/KmdcCl76oH/ibI34b8mD6Up7/FPf22r8ma
2KBth9TkNZ9ou1tX7CwqixP65HYXylGSHJb7YXgMbIFNNTXk3gPvWA8yBrWKOqRk
YIebJjNwyjRmokEdiqqOKnMV3V5444pbT/izK5IKulvFXy6AXY+yUB3cKd9or/fl
zLlAK8U2i/KDs3QTM4LNU7216CU1fl6mL8VWeZJ7jRrcqCeOXnwSzy60uckUXzCJ
nz69PA3VeCRuTQacQ/yVMujelpmHWu6NFJX6jEgTp5TlypglqrfgAlsfFWcR0xg+
nor14cUyQgKJyH4tPxh0x9Sl9oLOj1xizow2M2d/zahcH8hjjYdJBz+WRwJNGH8=
=P4g/
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to