[Linux-ha-dev] 1.0.4 rpm oddity
t.d.lee at durham.ac.uk
Thu Jan 22 11:02:40 MST 2004
On Thu, 22 Jan 2004, Horms wrote:
> On Wed, Jan 21, 2004 at 02:31:41PM +0000, David Lee wrote:
> > [...]
> > "heartbeat.spec.in" would usually cause something like:
> > useradd -g 65 hacluster
> > (Incidentally, I see that doesn't appear to include "-u 17" or similar.
> > Curious (my bad reading?). Anyway, to stick to the point...)
> > Instead, I did:
> > useradd -g 65 -u 17 -d '/' hacluster
> Yes, that does seem to be an oversight, the patch below should resolve
> this. Again I will put it into CVS once we get out of the current
> freeze. [ patch for "-u @HA_CCMUID@" component ]
> I am curious to know why you are concerned about -d at all.
> My understanding is that useradd (on Red Hat and everywhere else too)
> doesn't try to create the user's home directory unless you
> specify the -m option.
Disclaimer: I'm a newbie to Linux sys.adm. to may well be wrong!
Reading the manpage I would agree with you.
But something, somewhere tripped up when I tried the rpm; this was
repeatable with the "useradd ..." (without surrounding rpm complication).
(Our "/home" is an indirect automount map, so a "mkdir /home/blah" attempt
I've just verified it again. The simple:
useradd -g 65 -u 97 tdltest
gave an error:
useradd: cannot create directory /home/tdltest
whereas the explicit:
useradd -g 65 -u 97 -d /tmp/tdlxxx tdltest
(i.e. specify a home which can be mkdir'd) is OK: it makes the directory
"/tmp/tdlxxx" and populates it with a ".bashrc" and (a few other similar
So I suspect the "useradd" man page description of "-m" may be at variance
with useradd's behaviour.
Now if I do:
useradd -g 65 -u 97 -M tdltest
(that's a capital-M option) the passwd entry is made with "/home/tdltest"
but the home-directory creation is not attempted (or at least fails
OK, pulling all this together for our "hacluster" id:
1. Attempts to create a "/home/hacluster" are prone to failure at sites
where this is either the wrong place (local custom) or functionally
impossible (e.g. "/home" and indirect automount map);
2. We all seem happy that the "hacluster" id does not need a _functioning_
3. "useradd" won't allow "-d ''" (i.e. null home directory);
4. (Personal view): If passwd entry specifies a homedir, then I feel
that such a thing (whether used or not) ought to exist;
5. How about using something like "/etc/ha.d"? (RH9 systems seem to have
several ids with homedirs named after something that is both real and
related to the function being provided e.g. mail->/var/spool/mail).
6. Something like:
useradd -g ... -u ... -M -d /etc/ha.d hacluster
That's "-M" explicitly to disable homedir creation and a "-d ..."
so that the registered (though unused) homedir is vaguely sensible.
(Incidentally, this prompted to look at Solaris: it, too, has a "useradd"
whose man page seems to resemble the RedHat one. So all this RH
discussion could well be useful there, too.)
: David Lee I.T. Service :
: Systems Programmer Computer Centre :
: University of Durham :
: http://www.dur.ac.uk/t.d.lee/ South Road :
: Durham :
: Phone: +44 191 334 2752 U.K. :
More information about the Linux-HA-Dev