Summary: | acct-user.eclass - usermod fails if the uid, username, or homedir is changed for a running process | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | tdr <ted.d.rodgers> |
Component: | Eclasses | Assignee: | Michał Górny <mgorny> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | floppym, gentoo |
Priority: | Normal | Keywords: | PullRequest |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://github.com/gentoo/gentoo/pull/31595 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
tdr
2022-12-24 19:42:08 UTC
You should probably stop atd before removing that user. (In reply to Mike Gilbert from comment #1) > You should probably stop atd before removing that user. Sorry, I misread the bug at first and forgot to remove this comment. usermod aborts if we try to change the uid, username, or home directory of a user that currently has any processes running. I don't see any way to really avoid this other than stopping atd before you attempt to install acct-user/at. *** Bug 888191 has been marked as a duplicate of this bug. *** Hmm, perhaps there's room for improvement. One option would be to move this to preinst, so that package wouldn't be considered installed. We could also print instructions how to manually perform the update, so that the user could stop atd, update the user and restart it without having to retrigger the ebuild. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f06a34a08c256ca49f68ead9968738c49be6f0c commit 2f06a34a08c256ca49f68ead9968738c49be6f0c Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2023-06-24 16:52:13 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2023-06-26 18:57:38 +0000 acct-user.eclass: improve error message when usermod fails usermod refuses to update the home directory for a user with running processes. Output a more helpful message and avoid calling die for this. For other usermod failures, output stderr as an eerror message and die. Example output: * Failed to update user portage * This user currently has one or more running processes. * Please update this user manually with the following command: * usermod '--comment' 'System user; portage' '--home' '/var/lib/portage/home' '--shell' '/bin/bash' '--gid' 'portage' '--groups' '' portage Bug: https://bugs.gentoo.org/888189 Signed-off-by: Mike Gilbert <floppym@gentoo.org> eclass/acct-user.eclass | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) |