Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 454034

Summary: Removing package-added users/groups on unmerge
Product: Portage Development Reporter: Roman Žilka <roman.zilka>
Component: Core - Ebuild SupportAssignee: PMS/EAPI <pms>
Status: RESOLVED DUPLICATE    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Roman Žilka 2013-01-25 15:26:23 UTC
Some packages add new user accounts / groups on emerge. I think it would be nice if they removed these on unmerge. That way, the system would really become as clean as it had been before the emerge.

This deletion would include the accounts' homes and all superordinate directories created solely for those home dirs. E.g., lighttpd creates the user lighttpd with home=/var/www/localhost/htdocs. On unmerge, not just /var/www/localhost/htdocs should be removed, but the whole of
1. /var, if empty (except for the subdirs www/localhost/htdocs); if non-empty, then
2. /var/www, if empty (except for the subdirs localhost/htdocs); if non-empty, then
3. /var/www/localhost, if empty (except for the subdir htdocs); if non-empty, then
4. /var/www/localhost/htdocs, if empty.

This functionality should be taken care of easily by adding the homedir and its superordinates to the list of package-owned files (don't know if this happens purposefully now).

This would also take care of the SNAFU of a package unmerge deleting its own user's homedir. Take again lighttpd, which creates the account lighttpd with home=/var/www/localhost/htdocs, but also claims this dir as its own. On unmerge, it deletes this dir, if empty, but the account remains - homeless.

Reproducible: Always
Comment 1 Roman Žilka 2013-01-25 15:30:44 UTC
The account-removal feature could be a FEATURE then.
Comment 2 Zac Medico gentoo-dev 2013-01-25 15:39:01 UTC

*** This bug has been marked as a duplicate of bug 53269 ***