On the client, in /etc/profile
, put something like
# Request a home directory if ! [ -e ${HOME} ] ; then touch /home/homedir-request/${USER}.req sleep 30 ls ${HOME} sleep 30 #Is this too much? cd ${HOME} fi
On the server, run
sudo inoticoming --logfile /tmp/inoti.log --pid-file /var/run/inoticoming-homedirreq /lwphome/homedir-request --suffix .req --stderr-to-log /bin/sh /usr/local/sbin/create-lwp-homedir /lwphome/homedir-request/{} \;
Note that the directory being watched must be repeated as the path to the request file being handled |
... and have a script /usr/local/sbin/create-lwp-homedir
(run as root) that creates the home directory.
Note | |
---|---|
I 've created a package that will this, with and init script for the inoticoming instance and log rotation. You can request it by mail if your're interested. |
Note | |
---|---|
Maybe it is better to do this from a PAM module instead of from the .profile.
But PAM runs with root permission, and root doesn't have access to the NFSv4 share (rootsquash is on).
|