#!/bin/sh #set -x # Subroutines # ----------- echoc() { echo $1 | tee -a /var/sadm/system/logs/S99-02-oracle-svcs.sol_10_u11.log | tee -a /dev/console } err() { echoc echoc "\v\t Error: $*" echoc "\v\t Press any key to reboot in single-user mode ... " read x init s } mvsadmin=zarko.dudic@hp-domain.com # -------------------------------------------------------------------------- # Main # -------------------------------------------------------------------------- echoc echoc " S99-02-oracle-svcs: ------------ start --------------" echoc "S99-02-oracle-svcs: Update Oracle parametres: ... \t\c" #/usr/bin/prctl -n project.max-shm-memory -v 430gb -r -i project user.root \ #|| err "Can't run prctl to update Oracle parametres" /usr/sbin/projmod -sK "project.max-shm-memory=(priv,430gb,deny)" user.root \ || err "Can't run projmod to update Oracle parametres" echoc "OK" echoc "S99-02-oracle-svcs: Creating symbolic link needed by sudo ... \t\c" /usr/bin/ln -s /opt/csw/lib/libintl.so.8.1.1 /usr/lib/libintl.so.8 || err "Can't create symbolic link needed by sudo" echoc "OK" echoc "S99-02-oracle-svcs: Installing HPQsys using /tmp/admin file ... \t\c" /usr/sbin/pkgadd -a /tmp/admin -d /tmp HPQsys || err "Can't install HPQsys" echoc "OK" # ------------- Start: OVR Install ----------------- echoc "S99-02-oracle-svcs: Installing OVR ... " ovr_source="16.106.64.56:/export/mvs/software/ovr/sparc" echoc "Mount OVR source data and rsync it ... \c" [ -d /var/tmp/ovr ] || mkdir /var/tmp/ovr [ -d /tmp/mnt ] || mkdir /tmp/mnt mount -F nfs ${ovr_source} /tmp/mnt || err "Can't mount ${ovr_source}" /usr/local/bin/rsync -avH /tmp/mnt/ /var/tmp/ovr/ || err "Can't rsync OVR" echoc "OK" echoc "Un-mount source data ... \c" umount /tmp/mnt || err "Can't un-mount /tmp/mnt " echoc "OK" cd /var/tmp/ovr || err "Can't go to /var/tmp/ovr directory" ovr_pkg_list=" HPOvXpl HPOvSecCo HPOvBbc HPOvCtrl HPOvPacc HPOvPCO HPOvPetc HParm HPlwdce HPmwa " for ovr_pkg in ${ovr_pkg_list} do if [ -n "${ovr_pkg}" ] then response="/var/tmp/ovr/${ovr_pkg}.response" echoc "Installing package ${ovr_pkg} ... \c" if [ -f ${response} ] then pkgadd -n -a /var/tmp/ovr/admin -d /var/tmp/ovr -r ${response} ${ovr_pkg} || err "Can't install ${ovr_pkg}" else pkgadd -v -a /var/tmp/ovr/admin -d /var/tmp/ovr ${ovr_pkg} || err "Can't install ${ovr_pkg}" fi fi echoc "OK" done rm /var/tmp/ovr/*sparc || err "Can't remove OVR package datastream" echoc "S99-02-oracle-svcs : The OVR has been installed ... " # ----------- End : OVR Install ----------------- # ------------- Start : Dataprotector Install --------- echoc "S99-02-oracle-svcs : Installing the Dataprotector 6.11 ... " dp_source="16.106.64.56:/export/mvs/software/Dataprotector/DP6.11/sparc" dp_pkg_list=" OB2-CORE OB2-CC OB2-DA OB2-MA OB2-INTG OB2-OR8 " echoc "Mount Dataprotector 6.11 source and rsync it ... \t\c" [ -d /tmp/mnt ] || mkdir /tmp/mnt [ -d /var/tmp/dataprotector ] || mkdir /var/tmp/dataprotector mount -F nfs ${dp_source} /tmp/mnt || err "Can't mount ${dp_source}" for dp_pkg in ${dp_pkg_list} do /usr/local/bin/rsync -avH /tmp/mnt/${dp_pkg} /var/tmp/dataprotector/ || err "Can't rsync OVR" done /usr/local/bin/rsync -avH /tmp/mnt/admin /var/tmp/dataprotector/ || err "Can't rsync OVR admin file" echoc "OK" echoc "Un-mounting Dataprotector source ... \c" umount /tmp/mnt || err "Can't un-mount ${dp_source}" echoc "OK" for dp_pkg in ${dp_pkg_list} do echoc "Installing package ${dp_pkg} ... \c" pkgadd -n -a /var/tmp/dataprotector/admin -d /var/tmp/dataprotector ${dp_pkg} || err "Can't install ${dp_pkg}" echoc "OK" done echoc "S99-02-oracle-svcs : The Dataprotector 6.11 has been installed ... " # ------------- End : Dataprotector Install --------- echoc "S99-02-oracle-svcs: Mount Users' Home Directories ... \t\c" cp -p /etc/vfstab /etc/vfstab.orig || err "Can't backup /etc/vfstab" echo "#Mount for Home directories" >> /etc/vfstab || err "Can't update /etc/vfstab with comment" echo "g1o0007.austin.hp.com:/export/home - /export/home nfs - yes -" >> /etc/vfstab || err "Can't update /etc/vfstab with mount point" mkdir /export/home || err "Can't make dir /export/home" mount /export/home || err "Can't mount /export/home from g1o0007" echoc "OK" echoc "S99-02-oracle-svcs: Get Applications' Home Directories ... \t\c" umount /home || err "Can't un-mount /home" chmod 755 /home || err "Can't chmod of /home" [ -d /tmp/mnt ] || mkdir /tmp/mnt mount 16.106.64.56:/export/mvs/home /tmp/mnt || err "Can't mount 16.106.64.56:/export/mvs/home " /usr/local/bin/rsync -avH /tmp/mnt/home.tar /home/home.tar || err "Can't rsync home.tar" cd /home ; tar -xvf home.tar || err "Can't extract home.tar" cd / ; umount -f /tmp/mnt || err "Can't unmount /tmp/mnt" echoc "OK" echoc "S99-02-oracle-svcs: Perl : creating symbolic link ... \t\c" rm /usr/bin/perl || err "Can't remove /usr/bin/perl" ln -s /usr/local/bin/perl /usr/bin/perl || err "Can't create link for Perl " echoc "OK" echoc "S99-02-oracle-svcs: Get Security policy ... \t\c" [ -d /tmp/mnt ] || mkdir /tmp/mnt mount 16.106.64.56:/export/mvs/JASS_security-scripts /tmp/mnt || err "Can't mount 16.106.64.56:/export/mvs/JASS_security-scripts" /usr/local/bin/rsync -avH /tmp/mnt/EDSHPNGDCSST42v05.tar /var/tmp/ || err "Can't rsync policy tar file" tar -xvf /var/tmp/EDSHPNGDCSST42v05.tar || err "Can't extract Policy tar file" cd / ; umount -f /tmp/mnt || err "Can't unmount /tmp/mnt" echoc "OK" echoc "S99-02-oracle-svcs: Disabling and enabling some services ... \t\c" services_disable_list=" omni/tcp stosreg zones ocm cde-login cde-printinfo webconsole:console power " # service description: # ocm : used to collect configuration information for system and upload it to the Oracle repository for service_dis in ${services_disable_list} do /usr/sbin/svcadm disable ${service_dis} || err "Can't disable ${service_dis}" done # enabling ntp server services_enable_list=" ntp hotplug omni/tcp " for service_enable in ${services_enable_list} do /usr/sbin/svcadm enable -r ${service_enable} || err "Can't enable ${service_enable}" done echoc "OK" echoc "S99-02-oracle-svcs: Saving eeprom output ... \t\c" /usr/sbin/eeprom > /var/tmp/eeprom.backup || err "Can't save eeprom output" echoc "OK" echoc "S99-02-oracle-svcs: Emailing build report ... \t\c" echo " `/usr/bin/hostname` has been auto built (currently rebooting), next things have to be done manually: \ \n - Install & configure Powerbroker (binary in /var/tmp) - Install lftp if needed (binary in /var/tmp) - Install SSCS for domains that boot from StorEdge 3510 (binary: /var/tmp/2.5_fw_solaris_sparc.pkg) (Add line ses "scsiclass,03" in /etc/driver_aliases file and run command "touch /reconfigure" and reboot system) - Configure/enable multipathing with command (requires reboot): stmsboot -e - Configure Veritas Storage Foundation (mount g1o0007:/export/mvs/software/veritas/sparc/6.0.1/dvd1-sol_sparc/sol10_sparc and run: ./installer -configure ) - Verify /etc/passwd /etc/shadow /etc/group files (copy from relevant server) - Setup and test Failover NICs - Review OpenBoot Environments, check boot devices and test boot from both disks - Run first JASS pass, reboot, run second JASS pass, check for failures - If needed, FC Firmware can be upgraded with: luxadm -e forcelip /dev/cfg/c# " \ | mailx -s "Build report from `/usr/bin/hostname`" ${mvsadmin} \ || err "Can't email build report" echoc "OK" echo "`date` : 02 : HP-BCS Oracle & Services adjustment" >> /etc/release mv /etc/rc3.d/S99-02-oracle-svcs.sol_10_u11 /etc/rc3.d/_S99-02-oracle-svcs.sol_10_u11 echoc " S99-02-oracle-svcs: ------------ finish --------------" echoc " S99-02-oracle-svcs: system is being restarted in 90 sec ........." touch /reconfigure init 6 | tee -a /dev/console sleep 90 reboot -- -r