Solaris / OpenSolarisThis forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
It executes without error and creates the user as specified etc., but the contents of /etc/skel are not copied to the new user's home directory. It doesn't seem to make any difference if I specify the home directory as /home/<username> or /export/home/<username>.
The home directory is mounted via the automounter using the auto_home file. It already exists, and according to the man page for useradd, it needs to be writeable by the user's primary group, which it is.
Anybody see this problem before? Any ideas? Is it a known bug?
and it does appear to have worked! I'm not quite sure what's causing the problem, but I think it must be related to the fact that I had created the user's home directory and assigned group permissions in advance, as that's the biggest difference I can see between what I was trying originally and this method. However, that should work according to the useradd man page.
I still think there is a bug in useradd, but at least I know it does work if the directory isn't created in advance.
I still think there is a bug in useradd, but at least I know it does work if the directory isn't created in advance.
I don't think this can be qualified as a bug. Useradd isn't touching a home directory that already exists which makes sense.
However, the manual page could be improved. The sentence "This directory must already exist." in the "-k" description is certainly ambiguous. I guess you understood it to mean the user's home directory must exists while it really refers to the skeleton directory.
Distribution: Debian 6.0, RHEL5, Solaris 10, NetBSD-4
Posts: 202
Original Poster
Rep:
Quote:
Originally Posted by jlliagre
I don't think this can be qualified as a bug. Useradd isn't touching a home directory that already exists which makes sense.
However, the manual page could be improved. The sentence "This directory must already exist." in the "-k" description is certainly ambiguous. I guess you understood it to mean the user's home directory must exists while it really refers to the skeleton directory.
Thanks for the reply - the part I was looking at was actually this section:
Code:
-m Create the new user's home directory if it does not
already exist. If the directory already exists, it
must have read, write, and execute permissions by
group, where group is the user's primary group.
So I assumed that if I met these requirements (which I did), useradd would behave exactly as it does when the home directory does not exist in advance. However it appears that useradd doesn't behave the same if the user's home directory already exists.
From the useradd source code, '-m' flag is ignored if the directory already exists, and '-k' is only processed if the home directory is created by useradd.
This should probably be clarified in the man page.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.