Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#42018 - [gdm] pacman -Rs gdm - error: command failed to execute correctly

Attached to Project: Arch Linux
Opened by Adrián López (adrianlzt) - Friday, 19 September 2014, 08:43 GMT
Last edited by Jan de Groot (JGC) - Thursday, 28 May 2015, 13:15 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Jan Alexander Steffens (heftig)
Architecture All
Severity Low
Priority Normal
Reported Version 4.1.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
The 'install' file of the gdm package (https://projects.archlinux.org/svntogit/packages.git/tree/trunk/gdm.install?h=packages/gdm) has two small errors.

In line #3 useradd is called as "usr/sbin/useradd" (without the first slash). But works properly.

The second one is in post_remove() function and triggers the pacman error.
Reading the userdel man page: "If USERGROUPS_ENAB is defined to yes in /etc/login.defs, userdel will delete the group with the same name as the user."
In the post_remove() function first the user is deleted, then the group. But, if userdel deletes also the 'gdm' group, the command "getent group gdm" returns 2 and that is the return code of the whole function.


Steps to Reproduce:
"USERGROUPS_ENAB yes" in /etc/login.defs
pacman -S gdm
pacman -R gdm
This task depends upon

Closed by  Jan de Groot (JGC)
Thursday, 28 May 2015, 13:15 GMT
Reason for closing:  Fixed
Additional comments about closing:  gdm no longer deletes user/group on remove.
Comment by Oscar Garcia (ogarcia) - Friday, 19 September 2014, 08:50 GMT
I think that it can be fixed changing the following lines:

getent passwd gdm >/dev/null 2>&1 && userdel gdm
getent group gdm >/dev/null 2>&1 && groupdel gdm

To:

{ getent passwd gdm >/dev/null 2>&1 && userdel gdm; } || true
{ getent group gdm >/dev/null 2>&1 && groupdel gdm; } || true

In the post_remove() section.
Comment by Adrián López (adrianlzt) - Friday, 19 September 2014, 08:52 GMT Comment by Allan McRae (Allan) - Friday, 19 September 2014, 09:42 GMT
BTW, leading slashed are not needed.
Comment by Jan de Groot (JGC) - Friday, 19 September 2014, 11:12 GMT
IMHO we should revisit user creation/deletion anyways. I'm not happy with deleting userids after removing the package. Gdm creates logfiles and state files, after removing the package those files will remain on the filesystem without any user/gid assigned to it. When you install something else that takes the same uid/gid as gdm, those files will belong to that user instead.

Loading...