Msg#: 4126582 posted 8:47 am on May 4, 2010 (gmt 0)
I'm fed up of manually setting up NFS shares :(
How would I go about, on creating a user, creating some extra subdirectories in their home directory (is there a skeleton template somewhere) and adding some entries to /etc/fstab (I assume this will take some scripting to append the new entries to the end, but how do I trigger it?)
Msg#: 4126582 posted 12:22 pm on May 4, 2010 (gmt 0)
The skeleton directory is usually /etc/skel - adduser can copy the contents of this directory when creating a user (note: I only know about Debian/Ubuntu, don't know if this is the same for other distros). For the rest, I guess you could write a bash shell script to automate everything.
Msg#: 4126582 posted 3:04 pm on May 4, 2010 (gmt 0)
/etc/skel is also the skeleton directory for the RedHat family Linux distributions. There is no integrated scripting in the adduser or useradd tools (on some systems adduser and useradd are different commands) where you can add the creation of mount points in the /etc/fstab directory. If you want to perform all actions in one pass, a container shell script is needed which calls the adduser program and some home made scripting to update the fstab file.
Msg#: 4126582 posted 3:14 pm on May 4, 2010 (gmt 0)
Never mind, I've got a new approach. Write a script to handle the lot. Pass in username, uid and gid, then the script can create the group, add the user and do the appending to fstab... and I have to run even fewer commands to setup a user (which I need to do on the commandline anyway because easy-to-use *&^%* Ubuntu won't let me specify a uid (not that it always worked in previous versions of Kubuntu anyway!)).
<edit>Yay! I finally reached post 100!</yay> <edit again>I must have been typing while you were posting lammert. Thanks for confirming what I suspected</edit_again>