JumpStart プロファイルディレクトリを作成したマシンに root としてログインします。
「JumpStart インストールサーバーとプロファイルディレクトリを作成する」 の手順 2 で作成した JumpStart プロファイルディレクトリに移動します。
JumpStart 終了スクリプトを作成します。
「終了スクリプトのセキュリティーについて」 に目を通します。実際のセキュリティー要件に応じて、次の終了スクリプト例のいずれかをガイドラインとして使用して、終了スクリプトを JumpStart プロファイルディレクトリに作成します。
1 番目の例は、パスワードシードとコミュニティー文字列をハードコードした終了スクリプトです。2 番目の例は、実行時にパスワードシードとコミュニティー文字列の入力を求める終了スクリプトです。
終了スクリプトは、base_agent_finish.sh のように sh 拡張子を付けて保存します。
#!/bin/sh # # Program type : Unix bourne shell script # Description : Standard finish script for installing and # setting up Sun Management Center core agent # # # ROOTDIR=${ROOTDIR:-/a} # Root directory for new OS MNTDIR=${ROOTDIR}/mnt LOGDIR=${ROOTDIR}/var/tmp/sunmcfinish SI_CONFIG_DIR=${SI_CONFIG_DIR:-/export/home/JumpStart/jumpstart} INSTALL_RESP=${SI_CONFIG_DIR}/install.cfg SETUP_RESP=${SI_CONFIG_DIR}/setup.cfg # # # Begin Main Program # # umask 022 mkdir -p $LOGDIR # # Copy the install and setup response file to target system # cp ${INSTALL_RESP} $LOGDIR cp ${SETUP_RESP} $LOGDIR # # mount Sun Management Center image # mount -F nfs bootserver01:/export/home/JumpStart/AgentImage $MNTDIR [ $? -ne 0 ] && exit 1 # # run es-inst with -a -R -T and -A options # skip the next line for Flash Archive based deployment # Do not use the -T option if you have specified the TARGET_DIRECTORY # tag in install.cfg # ${MNTDIR}/disk1/sbin/es-inst -a -R /a -T /a/opt -A ${LOGDIR}/install.cfg # # Clean up any rc script with the same name if present # test -f ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart && \ rm -f ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart rm -f /etc/init.d/SunMCJumpStart # # Place rc script in rc3.d and init.d to do setup # Remember to access es-setup based on the target directory location # echo "Creating rc script..." cat > ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart << EOF #!/sbin/sh # rm /etc/rc3.d/S80SunMCJumpStart /etc/init.d/SunMCJumpStart SECURITY_SEED=abc123 SNMPV1_STRING=private export SECURITY_SEED SNMPV1_STRING /opt/SUNWsymon/sbin/es-setup -e -A /var/tmp/sunmcfinish/setup.cfg EOF cp ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart \ ${ROOTDIR}/etc/init.d/SunMCJumpStart exit 0
#!/bin/sh # # Program type : Unix bourne shell script # Description : Standard finish script for installing and # setting up Sun Management Center core agent # # # ROOTDIR=${ROOTDIR:-/a} # Root directory for new OS MNTDIR=${ROOTDIR}/mnt LOGDIR=${ROOTDIR}/var/tmp/sunmcfinish SI_CONFIG_DIR=${SI_CONFIG_DIR:-/export/home/JumpStart/jumpstart} INSTALL_RESP=${SI_CONFIG_DIR}/install.cfg SETUP_RESP=${SI_CONFIG_DIR}/setup.cfg # # # Begin Main Program # # umask 022 mkdir -p $LOGDIR # # Copy the install and setup response file to target system # cp ${INSTALL_RESP} $LOGDIR cp ${SETUP_RESP} $LOGDIR # # mount Sun Management Center image # mount -F nfs bootserver01:/export/home/JumpStart/AgentImage $MNTDIR [ $? -ne 0 ] && exit 1 # # Read secure inputs from user who invoked boot net - install # echo "Enter Security seed:" read SECURITY_SEED echo "Enter SNMP string:" read SNMPV1_STRING # # run es-inst with -a -R -T and -A options # skip the next line for Flash Archive based deployment # Do not use the -T option if you have specified the TARGET_DIRECTORY # tag in install.cfg # ${MNTDIR}/disk1/sbin/es-inst -a -R /a -T /a/opt -A ${LOGDIR}/install.cfg # # create a temporary es-setup script to use the secure information # read earlier # Remember to access es-setup based on the target directory location # FILE2=/a/opt/SUNWsymon/sbin/es-setup FILE=/a/opt/SUNWsymon/sbin/es-setup.jumpstart mv $FILE2 $FILE count=`wc -l $FILE` count=`echo $count | cut -d' ' -f1` ncount=$count count_enter=`expr $ncount - 3` while [ $ncount -gt 0 ] ; do k=`tail -$ncount $FILE | head -1` if [ $ncount -eq $count_enter ] then echo $k >> $FILE2 echo "SECURITY_SEED=$SECURITY_SEED" >> $FILE2 echo "SNMPV1_STRING=$SNMPV1_STRING" >> $FILE2 else echo $k >> $FILE2 fi ncount=`expr $ncount - 1` done chmod +x $FILE2 # # Clean up any rc script with the same name if present # test -f ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart && \ rm -f ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart \ rm -f /etc/init.d/SunMCJumpStart # # Place rc script in rc3.d and init.d to do setup and cleanup # Remember to access es-setup based on the target directory location # echo "Creating rc script..." cat > ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart << EOF #!/sbin/sh # rm /etc/rc3.d/S80SunMCJumpStart /etc/init.d/SunMCJumpStart /opt/SUNWsymon/sbin/es-setup -e -A /var/tmp/sunmcfinish/setup.cfg mv /opt/SUNWsymon/sbin/es-setup.jumpstart /opt/SUNWsymon/sbin/es-setup EOF cp ${ROOTDIR}/etc/rc3.d/S80SunMCJumpStart \ ${ROOTDIR}/etc/init.d/SunMCJumpStart exit 0