#! /bin/sh # # $Id: nw_clnt_postinstall.SunOS,v 1.14.26.4 2007/04/20 01:16:18 stowed Exp $ Copyright (c) 2005-2007 EMC Corporation # # # Copyright (c) 2005-2007 EMC Corporation. # # All rights reserved. This is an UNPUBLISHED work, and # comprises proprietary and confidential information of EMC. # Unauthorized use, disclosure, and distribution are strictly # prohibited. Use, duplication, or disclosure of the software # and documentation by the U.S. Government is subject to # restrictions set forth in a license agreement between the # Government and EMC or other written agreement specifying # the Government's rights to use the software and any applicable # FAR provisions, such as FAR 52.227-19. # PATH=/usr/sbin:/usr/bin:/sbin PRODUCT_NAME="Sun StorageTek EBS" #============================================================================== # Function: create_nsrhome # Summary: create the /nsr directory structure #============================================================================== create_nsrhome() { echo "Creating the /nsr directory structure" # create the specified directory if [ ! -d ${PKG_INSTALL_ROOT}/${NSR_HOME} ]; then mkdir -p ${PKG_INSTALL_ROOT}/${NSR_HOME} fi # create the /nsr sym link if [ "X${NSR_HOME}" != "X/nsr" ]; then if [ ! -h ${PKG_INSTALL_ROOT}/nsr ]; then ln -s ${NSR_HOME} ${PKG_INSTALL_ROOT}/nsr elif [ `ls -l /nsr | awk '{print $11}'` != ${NSR_HOME} ]; then mv ${PKG_INSTALL_ROOT}/nsr ${PKG_INSTALL_ROOT}/nsr.old ln -s ${NSR_HOME} ${PKG_INSTALL_ROOT}/nsr fi fi } #============================================================================== # Function: create_servers # Summary: create the servers file #============================================================================== create_servers() { echo "Creating the /nsr/res/servers file" if [ ! -d ${PKG_INSTALL_ROOT}/${NSR_HOME}/res ]; then mkdir ${PKG_INSTALL_ROOT}/${NSR_HOME}/res fi cat>${PKG_INSTALL_ROOT}/${NSR_HOME}/res/servers<> ${PKG_INSTALL_ROOT}/${NSR_HOME}/res/servers done } #============================================================================== # Function: create_scripts # Summary: create startup script and symlinks to rc directories #============================================================================== create_scripts() { echo "Creating ${PRODUCT_NAME} start/stop scripts" if [ $PKGINST = LGTOclnt ]; then NSREXECD=${CLIENT_BASEDIR}/sbin/nsrexecd LGTOLMD=${CLIENT_BASEDIR}/sbin/lgtolmd NSRD=${CLIENT_BASEDIR}/sbin/nsrd NSR_SHUTDOWN=${CLIENT_BASEDIR}/sbin/nsr_shutdown CLUSTER=${CLIENT_BASEDIR}/sbin/NetWorker.clustersvr NSRWIZRES=${CLIENT_BASEDIR}/sbin/nsrwreg SRVRPKGNAME=LGTOserv else NSREXECD=${CLIENT_BASEDIR}/sbin/nsr/nsrexecd LGTOLMD=${CLIENT_BASEDIR}/sbin/lgtolmd NSRD=${CLIENT_BASEDIR}/sbin/nsr/nsrd NSR_SHUTDOWN=${CLIENT_BASEDIR}/sbin/nsr/nsr_shutdown CLUSTER=${CLIENT_BASEDIR}/sbin/nsr/NetWorker.clustersvr NSRWIZRES=${CLIENT_BASEDIR}/sbin/nsr/nsrwreg SRVRPKGNAME=SUNWebss fi # create /etc/init.d/networker cat>${PKG_INSTALL_ROOT}/etc/init.d/networker< /dev/console if [ -x "\${NSREXECD}" ]; then if [ -f "\${CLUSTER}" ]; then if [ -f "\${PKG_INSTALL_ROOT}/nsr.NetWorker.local" -o -h "\${PKG_INSTALL_ROOT}/nsr.NetWorker.local" ]; then if [ -h "\${PKG_INSTALL_ROOT}/nsr" ]; then rm -f \${PKG_INSTALL_ROOT}/nsr ln -s \${PKG_INSTALL_ROOT}/nsr.NetWorker.local \${PKG_INSTALL_ROOT}/nsr fi fi fi (\${NSREXECD}) > /dev/console 2>&1 (echo ' nsrexecd') > /dev/console fi # # For Solaris 10, /usr/sbin is share between global and sparse zones. This means # the /etc/init.d/networker script will run it for the sparse/small zone also # regardless of what was installed on that zone. # # This fix prevents the license manager and the Server from being launched on # a non-global (or local) zone. # if [ -x "\${LGTOLMD}" ]; then # only run lgtolmd if it's from LGTO package pkginfo -q \${LGTOLICPKG} if [ \$? -eq 0 ]; then (\${LGTOLMD} -p /nsr/lic -n 1) > /dev/console 2>&1 (echo ' lgtolmd') > /dev/console fi fi if [ -x "\${NSRD}" -a ! -f "\${CLUSTER}" ]; then # only run nsrd if Server package installed pkginfo -q ${SRVRPKGNAME} if [ \$? -eq 0 ]; then (\${NSRD}) > /dev/console 2>&1 (echo ' nsrd') > /dev/console fi fi if [ -x "\${NSRWIZRES}" ]; then (\${NSRWIZRES}) > /dev/console 2>&1 fi ;; 'stop') (echo 'stopping ${PRODUCT_NAME} daemons:') > /dev/console if [ -x "\${NSR_SHUTDOWN}" ]; then (\${NSR_SHUTDOWN} -q) > /dev/console 2>&1 (echo ' nsr_shutdown -q') > /dev/console fi ;; *) echo "usage: \`basename \$0\` {start|stop}" ;; esac ! chmod 744 ${PKG_INSTALL_ROOT}/etc/init.d/networker # create the sym links ln -s /etc/init.d/networker ${PKG_INSTALL_ROOT}/etc/rc2.d/S95networker ln -s /etc/init.d/networker ${PKG_INSTALL_ROOT}/etc/rc0.d/K05networker } #============================================================================== # Function: clnt_add_rpc # Summary: add entries to /etc/rpc #============================================================================== clnt_add_rpc() { echo "Adding ${PRODUCT_NAME} entries to /etc/rpc" file=${PKG_INSTALL_ROOT}/etc/rpc # add entries for rap searchstr='^rap' grep "${searchstr}" ${file} > /dev/null 2>&1 if [ $? -ne 0 ]; then cat >>${file} <<-! rap 390101 rapla rapserv 390102 raprd ! fi # add entries for nsr searchstr='^nsr' grep "${searchstr}" ${file} > /dev/null 2>&1 if [ $? -ne 0 ]; then cat >>${file} <<-! nsrd 390103 nsr nsrmmd 390104 nsrmm nsrindexd 390105 nsrindex nsrmmdbd 390107 nsrmmdb nsrstat 390109 nsrjb 390110 nsrjbd nsrexec 390113 nsrexecd nsrlcpd 390429 nsrlcpd nsrmmgd 390430 nsrmmgd nsrntyfd 390432 nsrjobd 390433 ! fi # add entries for hagent searchstr='^hagent' grep "${searchstr}" ${file} > /dev/null 2>&1 if [ $? -ne 0 ]; then cat >>${file} <<-! hagentd 390427 ! fi } #============================================================================== # Function: start_daemons # Summary: create the servers file #============================================================================== start_daemons() { if [ "X${RESTART_DAEMONS}" = "Xyes" ]; then echo "Starting the ${PRODUCT_NAME} daemons" /etc/init.d/networker start fi } #============================================================================== # Function: main #============================================================================== create_nsrhome create_servers create_scripts clnt_add_rpc start_daemons exit 0