Red Hat Bugzilla – Bug 462054
Useradd errors reported when installing packages
Last modified: 2012-09-06 16:29:10 EDT
Description of problem:
After installing the latest shadow-utils I'm seeing errors like this in /var/log/secure
Sep 11 14:58:05 bilin1 useradd: failed adding user `sshd', data deleted
Sep 12 05:19:39 bilin1 useradd: failed adding user `backuppc', data deleted
I can find no trace of similar messages coming up before. In the case of the backuppc error, no such user exists on the system so it looks like the command has completely failed.
Version-Release number of selected component (if applicable):
Happened consistently across 6 different servers.
Steps to Reproduce:
1.Install latest shadow utils
2.Use yum to upgrade other packages (openssh-server?)
Errors appear in /var/log/secure. The new user is not created.
This happens on both i386 and x86_64.
Having looked at this a bit more, it seems that this error appears in the secure log when rpm tries to install a user which already exists. Trying the same command from the spec file on the command line gets me:
useradd: user backuppc exists
..which makes sense, but /var/log/secure still says:
useradd: failed adding user `backuppc', data deleted
I'm not sure what the 'data deleted' means, or if this is a new message, but it's being reported in logwatch reports when I don't remember seeing it before.
The original report is incorrect in that it says that the user is not created. It seems that this actually happens when the useradd fails because the user already exists.
# useradd foo
# useradd foo
useradd: user foo exists
# tail /var/log/secure
Sep 16 10:18:41 xen80 useradd: new group: name=foo, GID=501
Sep 16 10:18:41 xen80 useradd: new user: name=foo, UID=501, GID=501, home=/home/foo, shell=/bin/bash
Sep 16 10:18:46 xen80 useradd: failed adding user `foo', data deleted
# rpm -q shadow-utils
Simon, it seems this behaviour is common for shadow-utils for longer time. (at least shadow-utils-4.0.3). When something goes wrong useradd always just generate this syslog message. Note, it prints "useradd: user foo exists" on command line.
If you think this should be changed, please start some discussion on fedora-devel or shadow-utils upstream. It should be some consensus about it before we could start changing it.
i fix this error doing this:
1- mv /sbin/useradd /sbin/useradd.bin
2- create an script called '/sbin/useradd' whith the next code: