Laszlo (Laca) Peter wrote: > On Wed, 2008-09-17 at 07:48 +0100, Ghee Teo wrote: > >> #!/bin/sh >> # >> # Copyright 2008 Sun Microsystems, Inc. All rights reserved. >> # Use is subject to license terms. >> # >> # Preinstall script will check if zfssnap role already exists >> # and add it if necessary >> /usr/bin/grep "^zfssnap:" $BASEDIR/etc/passwd > /dev/null >> if [ $? -ne 0 ]; then >> /usr/sbin/roleadd -d /export/home/zfssnap -c "ZFS Automatic Snapshots >> role" \ >> >> GT> You are making the assumption that /export/home is available on the >> machine >> which I don't think it is always correct. I know users-admin does use >> /export/home >> as default, not sure if it checks for its presence or not. >> >> -P "ZFS File System Management" \ >> -A solaris.smf.manage.zfs-auto-snapshot -m zfssnap >> /usr/bin/passwd -r files -N zfssnap >> # make sure zfssnap's PATH has /usr/sbin in it >> echo "PATH=/usr/sbin:/usr/bin" >> /export/home/zfssnap/.profile >> echo "export PATH" >> /export/home/zfssnap/.profile >> fi >> > > Actually, this is totally wrong. On Nevada, it would try to add a > role on the system where the installer is running (e.g. the install DVD > or the BE you're LUing from) and on the system you're > installing/upgrading. I'm also wondering why a role needs a home > directory, is it only for adding /usr/sbin to the PATH? Can you > not make zfs-auto-snapshot not depend on /usr/sbin being in the PATH? > > In order not to have to use roleadd: http://monaco.sfbay.sun.com/detail.jsf?cr=6750041
The role initially needed a home because the SMF method was run as the zfssnap role user (non root priviliged) and needed somewhere to write it's logs to. Tim's adjusting this to make the logging less verbose by default and just use syslog instead. It may also be possible to drop the /usr/sbin PATH requirement I will sync up with Tim and get as much as this postinstall stuff removed as possible. Cheers, Niall. > I know I asked you about this but forgot the answer: is this package > going into Nevada? > > Laca > > >
