Hi Dave and Ghee, Dave Lin wrote: > >> %pre >> #!/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. > Niall, > > It's quite common for end user that "/export/home" doesn't exist on > the system. > > (I'm sorry to give this input late) No problem. We're all busy :) > Here is my concerns about your postinstall script, > 1, I think the proper approach is to let ON team to add the new user > for you, just as what Jim Li did for SUNWslocate Tracked:
http://monaco.sfbay.sun.com/detail.jsf?cr=6750041 > 2, Is it possible to let postrun/desktop-cache run the commands > instead of running directly in postinstall script The only thing we do in post install is to add the user, we should not need to do this after 6750041 is resolved. Additionally, Tim is changing the zfs-auto-snapshot component so that the home directory will not be under /export/home and instead be under "/". The home directory under /export/home was initially necessary because a logging directory was needed. This will not be necessary shortly and I will be able to drop this part of the post install script. > 3, If you want to run the commands directly in the script, you need to > add some lines to check the Zone environment, see examples in > SUNWgnome-a11y-libs.spec Will do that. My aim is to eliminate all the post install scripts since the roleadd should hopefully no longer be necessary when 6750041 is fixed. I will sync up with the hg tip of zfs-auto-snapshot and update the spec file. Thanks, Niall. > > Dave >> >> -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 >
