[techtalk] groupadd/useradd difficulties
Julie
jockgrrl at austin.rr.com
Thu Jun 14 20:31:17 EST 2001
gabriel gryffyn wrote:
>
> hi,
>
> i just installed Mandrake 8.0, and am having some trouble with useradd, of
> all things.
>
> the most obvious problem is that when i use groupadd, i get an error that
> says: "error locking group file" i get this same error when i use useradd
> -g and try to specify a group.
I don't have the newer Shadow sources -- mine date back to '95 or so
;-),
so things may have changed. A lot.
So this assumes nothing has changed ...
The group file locking function is gr_lock(). It creates a file named
/etc/group.<PID> into which it writes the PID of the locking process.
It then attempts to link() /etc/group.<PID> to /etc/group.lock. If that
is successful /etc/group is considered "locked". If that =fails= there
are some sanity tests to check the contents of /etc/group.lock to see
if the PID that's in there is a valid process. There were some races,
so I wouldn't be surprised if the function has changed a bit, but I
would
be surprised if Marek (the guy who took over maintenance from me)
changed
the basic operation.
So ... look for files named /etc/group.* and see if they make any sense.
> in what might be a related problem (or might not be--i don't know) i can't
> get apache to correctly serve documents out of new user's home
> directories. the two users i added during the mandrake install process can
> have public_html directories and everything works fine. but the users i've
> added with useradd after install generate a 403 forbidden error. (the
> problem here isn't with the file/directory permission--i know those are
> right. i'm pretty sure it isn't a problem with my apache configuration,
> since i'm using a very similar httpd.conf as a previous install, and apache
> serves fine from the home directories of people who were added to the
> system during install. which is what leads me to believe it might be a
> problem with the way useradd is adding people to the system.)
useradd doesn't do anything other than create entries in /etc/passwd,
/etc/shadow and perhaps /etc/group and /etc/gshadow. It almost sounds
like there is a list of permitted users that Apache knows about and
useradd isn't adding them there. Just a guess, tho ...
> i thought useradd and groupadd were very simple programs, but now that i'm
> getting weird errors, i'm beginning to wonder. has anyone had any similar
> trouble, or have any insights into how i might fix this? any help at all
> would be much appreciated!
I dunno how =you= quantify "simple", but I consider them to be fairly
simple ...
-- Julie.
--
8:21pm up 12:38, 3 users, load average: 0.18, 0.13, 0.10
More information about the Techtalk
mailing list