> %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)
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
2, Is it possible to let postrun/desktop-cache run the commands instead 
of running directly in postinstall 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

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


Reply via email to