Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1051525

Summary: Remove user -- keep files: running '/usr/sbin/userdel' failed: Child process exited with code 8
Product: Red Hat Enterprise Linux 7 Reporter: Martin <mholec>
Component: control-centerAssignee: Bastien Nocera <bnocera>
Status: CLOSED CURRENTRELEASE QA Contact: Desktop QE <desktop-qa-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: mboisver, mclasen, svenkatr, tpelka
Target Milestone: rc   
Target Release: 7.0   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1051629 (view as bug list) Environment:
Last Closed: 2014-06-13 09:19:48 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1051629    

Description Martin 2014-01-10 14:14:05 UTC
Version-Release number of selected component (if applicable):
RHEL-7.0-20140109.n.0

Steps to Reproduce: 
Add a user account you won't mind deleting


 1. Go to User Accounts (Settings)
 2. Unlock settings
 3. Click on the account you'd like to delete
 4. Click on the - sign below.
 5. Click 'Keep files'



Actual results: 
dialog window pops-up: running '/usr/sbin/userdel' failed: Child process exited with code 8

Expected results:
The account should be removed and his home directory shouldn't be deleted

Comment 1 Martin 2014-01-10 14:16:35 UTC
When I choose "delete files" instead, I don't get any error.

Comment 2 Matthias Clasen 2014-01-10 17:20:35 UTC
Exit code 8 means: user is still logged in. We could certainly provide a better error message here. If you choose 'delete', we pass -f to userdel, so it goes ahead even though the user is still logged in.

Comment 3 Matthias Clasen 2014-01-10 18:14:05 UTC
An issue here in the control-center is that we fail to take console logins into account when determining if the user is still logged in. The fix for that is

https://git.gnome.org/browse/gnome-control-center/commit/?id=2991d704762797f2e09e3cf1d003d5a6a6608660

Comment 4 Martin 2014-01-13 14:30:49 UTC
(In reply to Matthias Clasen from comment #2)
> Exit code 8 means: user is still logged in. We could certainly provide a
> better error message here. If you choose 'delete', we pass -f to userdel, so
> it goes ahead even though the user is still logged in.

The only problem is that user was not logged in, when I tested this.

Comment 6 Michael Boisvert 2014-01-28 20:22:59 UTC
Using the reproducer in the description, I was able to delete a user and keep their files without an error message. The home folder also remained on the system correctly.

Verified.

Comment 7 Michael Boisvert 2014-01-31 15:04:56 UTC
I should clarify that with a user logged into the machine via SSH, the error message when trying to delete the user has been appropriately changed. Still verified.

Comment 8 Ludek Smid 2014-06-13 09:19:48 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.