On 7/3/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> >> Currently, I'm using executable maps to create zfs >> home directories. >> >> Casper > > >Casper, anything you can share with us on that? Sounds interesting. It's really very lame: Add to /etc/auto_home as last entry: +/etc/auto_home_import And install /etc/auto_home_import as executable script: #!/bin/ksh -p # # Find home directory; create directories under /export/home # with zfs if they do not exist. # hdir=$(echo ~$1) if [[ "$hdir" != /home/* ]] then # Not a user with a valid home directory. exit fi # # At this point we have verified that "$1" is a valid # user with a home of the form /home/username. # h=/export/home/"$1" if [ -d "$h" ] then echo "localhost:$h" exit 0 fi /usr/sbin/zfs create "export/home/$1" || exit 1
another way to do this that is quicker if you are executing this often is create a user directory with all the skel files in place, snapshot it, then clone that directory and chown the files. zfs snapshot /export/home/[EMAIL PROTECTED] export/home/$1 ; chown -R /export/home/$1 James Dickens uadmin.blogspot.com
cd /etc/skel umask 022 /bin/find . -type f | while read f; do f=$(basename $f) # Remove optional local prefix /etc/skel files. f="$h/${f##local}" cp "$f" "$t" chown "$1" "$t" done chown "$1" $h echo "localhost:$h" exit 0 _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
_______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss