#!/sbin/sh ############################################################################## # Example script for setting up DSEE6 instance for QA testing in a Solaris Zone ############################################################################## if [ -n "${1}" ]; then instance=`basename ${1}`; else instance='ds1';fi if [ -n "${2}" ]; then pw="${2}"; else pw='sundsee6';fi host=`uname -n` port=1389 sport=1636 dsccport=3998 dsccsport=3999 suffix="dc=example,dc=com" bits="DSEE.6.2.Solaris10-X86_AMD64-full.tar.gz" bDir=/data/images iDir=/opt/SUNWdsee sDir=/${instance} tcuser='tomcat' tcgroup=${tcuser} ############################################################################## # # Define appropriate usage # usage() { echo "Usage: $0 " exit } ############################################################################## # # Define exit level error message routine # error_message() { errmsg=$1 if [ -n "${errmsg}" ] then exec 1>&2 echo -e "Error: ${errmsg}" exec 1>&1 exit 1 fi } ############################################################################## # # Check for package requisites # ck4pkgs=`pkginfo SUNWcacaort SUNWxcu4 | grep "was not found"` if [ -n "${ck4pkgs}" ] then error_message "Please make sure that the following packages are installed:\n SUNWxcu4 SUNWcacaort" fi ############################################################################## # # Setup environment variables # CATALINA_HOME=/opt/csw/share/tomcat5 CATALINA_BASE=${CATALINA_HOME} JAVA_HOME=/usr/java PATH="$PATH:$JAVA_HOME/bin:${iDir}/ds6/bin:${iDir}/dscc6/bin:${iDir}/dps6/bin:${iDir}/dsrk6/bin:." export CATALINA_HOME CATALINA_BASE JAVA_HOME PATH ############################################################################## # # Extract and deploy the bites # mkdir "${iDir}" cd "${bDir}" gunzip -fc "${bDir}/${bits}" > dsBits.tar if [ -d DSEE_ZIP_Distribution ] then rm -fr DSEE_ZIP_Distribution fi tar -xf dsBits.tar DSEE_ZIP_Distribution rm -f dsBits.tar cd DSEE_ZIP_Distribution ./dsee_deploy install -I -c ALL -O -i "${iDir}" rm -fr DSEE_ZIP_Distribution ############################################################################## # # Set up the DSCC # pwf='/.pwf' echo "${pw}" > "${pwf}"; chmod 400 "${pwf}" # # Create the DSCC container making sure that the ads user/ownership # the tomcat instance runtime user. # mkdir -p "${iDir}/var/dscc6/dcc" chown ${tcuser}:${tcgroup} "${iDir}/var/dscc6/dcc" "${pwf}" su - $tcuser -c "${iDir}/dscc6/bin/dsccsetup ads-create -i -w \"$pwf\"" # # Deploy the DSCC war file # cp ${iDir}/var/dscc6/dscc.war ${CATALINA_BASE}/webapps /etc/init.d/cswtomcat5 stop /etc/init.d/cswtomcat5 start ############################################################################## # # Set up an instance # dsadm create -w "$pwf" -h ${host} -p ${port} -P ${sport} "${sDir}" # Start ds dsadm start "${sDir}" # Configure ds the way we want it. dsconf set-server-prop -c -i -w "$pwf" -h ${host} -p ${port} \ max-thread-per-connection-count:5 \ db-cache-size:512k \ import-cache-size:20M \ "db-log-path:${sDir}/db/TxLog" \ "db-env-path:/tmp${sDir}" dsadm stop "${sDir}" mkdir -p "${sDir}/db/TxLog"; mv "${sDir}/db/log."* "${sDir}/db/TxLog" rm -f "${sDir}/db/__db*" dsadm start "${sDir}" # Add the suffix, sub-suffix, set sub-suffix parent dn, and tune entry caches dsconf create-suffix -c -w "$pwf" -h ${host} -p ${port} "${suffix}" dsconf set-suffix-prop -i -w "$pwf" -h ${host} -p ${port} "${suffix}" entry-cache-size:500k # Enable replication dsconf enable-repl -i -w "$pwf" -h ${host} -p ${port} --repl-id 1 master "${suffix}" # Register the instance with ads #dsccreg add-server -i -h ${dscchost} -p ${dsccport} -H ${host} -w "$pwf" -G "$pwf" -d master dsee6 "${sDir}" dsccreg add-server -i -w "$pwf" -G "$pwf" -d "master dsee6" "${sDir}" ############################################################################## # # Load some sample data # cd "${iDir}/dsrk6/bin/example_files" ../makeldif -t example.template -o example.ldif #../ldapmodify -ac -D "cn=Directory Manager" -j "${pwf}" -f example.ldif dsconf import -i -w "$pwf" -h ${host} -p ${port} "${iDir}/dsrk6/bin/example_files/example.ldif" "${suffix}"