Greetings!
I have a number of machines that are set up with LDAP Authentication. The LDAP also stores the path to the user's home directory. That user home directory is actually on an NFS server. So the path stored in LDAP for user bubba is: /homedirs/bubba. I use automount to mount each user's home when they log in. That part works great. So the user logs in via LDAP, gets their NFS home mounted, and all is good.
However, we have a second set of machines that need to be set up in the same way. This second set of machines will need a different set of preferences. IE - must use a different home directory. This will use the same NFS server space for the home dir. I tried to just change the mount point via automount to /homedirs/bubba/unix01. But, couldnt log in, because unix01 dir did not exist. This is where I am having a heck of a time. Ultimately, I'd like to have a different home dir for each set of machines like: /homedirs/bubba/unix01, /homedirs/bubba/unix02. And that unixXX directory be made if it doesnt exist, upon the user logging in.
I could just do a bash script somewhere that would "If not exist /homedirs/$USER/unix01, mkdir /homedirs/$USER/unix01". But not sure where to put it. Anything in .profile, .bashrc, would be too late.
The options of manipulating the LDAP server itself, or of just creating those dirs on the NFS server are out. (There are 10s of thousands of users.. and the NFS server is controlled by another entity)
Any thoughts on this would be much appreciated. Or perhaps a different take on how to solve this. My mind is spinning!
(Hope I explained this clearly enough)