adduser "delay" causing problems in rpm %pre scripts

Erik LaBianca erik at totalcirculation.com
Wed Aug 18 16:10:14 UTC 2004


OK,

So I'm trying to finish bringing my development environment up to FC2. I
have several packages I need (mach being one of them) that attempt to
install new users and groups for themselves in their %pre scripts. This
used to work fine, but now installing them I get lots of "warning: group
mach does not exist - using root" spam. Usually upon checking
/etc/passwd and /etc/group, the new user/group have been created, but
for some reason there is a lag between the useradd command the new users
subsequent availability to the system. 

I'm running LDAP auth, and I have already tried turning off nscd which
didn't help.

I believe this to be the same problem reported at
http://www.redhat.com/archives/fedora-list/2004-July/msg05419.html but
there was no resolution there, and a cursory search of bugzilla isn't
getting me anywhere. 

I either need a workaround for this on my local machine (how did it
"break" anyway?) or a way to fix the useradd commands in my rpm scripts
so they block until the new user is available. Inserting a sleep 5
didn't seem to do the trick, either.

FYI, the current command line looks like this:
/usr/sbin/useradd -g mach -c "mach user" \
        -r -m mach -d %{_localstatedir}/lib/mach > /dev/null 2>&1 || :

RFE: rpm should have a %createuser and %creategroup directives that
handle this sort of stuff. They should have flags to remove (or not) on
uninstall, etc.

Thanks.

--erik







More information about the fedora-devel-list mailing list