Content Server 6.7 Patch 4 automatic deployer (RedHat/Linux)

Patching anything can be boring. Patching a content server is no exception. Here is a 2-part script which makes life easier. If anyone knows how to upload shell scripts and properly format them in wordpress please let me know. However, PM me if you want the shell scripts mailed to you. If you have improvements please let me know.

This applies to Linux Content Server 6.7 Patch04 and requires a secure shell, access as the installation owner and access to a user with root or root access.

1. Login as the installation owner and copy up the patch04 “gz” file to $DOCUMENTUM
2. Stop Java Method Server and Content server
3. In the shell, execute patch04_step1.sh <REPO>
4. su root (not su -) or ask root user to execute the script run_as_root.sh which is automatically generated
5. exit back or otherwise log back in as installation owner.
6. execute patch04_step2.sh <REPO> <INSTALLOWNER>

Done.

I take no responsibility for anything so run at own risk

patch04_step1.sh


#!/bin/bash
# Patch deployment script version 1.0 for Content Server CS_6.7.0040.0238 Patch 4 - Script part 1
# Kevin Yeandel. Use at own risk. No responsibility taken by me.
# Prerequisits - Steps 1 to 4 of DocumentumContentServer_6.7_P04 have been completed.
if [[ -z $DOCUMENTUM ]] ; then
echo "\$DOCUMENTUM NOT SET" ;
exit 1;
else
echo "\$DOCUMENTUM set - OK";
fi

if [[ -z $DOCUMENTUM_SHARED ]] ; then
echo "\$DOCUMENTUM_SHARED NOT SET" ;
exit 1;
else
echo "\$DOCUMENTUM_SHARED set - OK";
fi

if [[ "$1" == "" ]] ; then
echo "USAGE $0 "
exit 1
fi

REPO=$1

if [[ ! -f "$DOCUMENTUM/dba/dm_start_$REPO" ]] ; then
echo "REPOSITORY $REPO does not seem to exist. Please check repository name"
exit 1
fi

#Define the patch file here (located in $DOCUMENTUM)
INITFILE=""
XML_STORE="N"
FAST="N"
XPLORE="Y"
PATCH=CS_6.7.0040.0238_linux_ora.tar
GUIDE="DocumentumContentServer_6.7_P04.pdf"
SIGNATURE="b7e8940dd6b129f5e0634d43c4bd204e"

# patch 03 was CS_6.7.0030.0232_linux_ora.tar
echo "Press enter to confirm the following 3 items or ctrl+c to abort"
echo "Item 1. FAST is installed:$FAST"
echo "Item 2. XPLORE is installed:$XPLORE"
echo "Item 3. XML_STORE is installed:$XML_STORE"
echo "(Where Y is Yes and N is No)"
read n

I_OWNER=`ls -l install.log | awk '{ print $3 }'`
GROUP=`ls -l install.log | awk '{ print $4 }'`
echo "GROUP is $GROUP"

if [[ $I_OWNER == `whoami` ]] ; then
echo "Patch execution by installation owner"
else
echo "You are not logged in as the installation owner. Quitting"
exit 1
fi

if [[ -f $DOCUMENTUM/$PATCH.gz ]] ; then
echo "file $PATCH exists"
else
echo "$PATCH.gz does not exit"
exit 1
fi

SUM=`md5sum $DOCUMENTUM/$PATCH.gz`

if [[ `md5sum $PATCH.gz | awk '{ print $1 }'` = $SIGNATURE ]] ; then
echo "SIGNATURE OK" ;
else
echo "The SIGNATURE ($SUM) does not match the patch (should be $SIGNATURE). Please validate your downloaded file"
exit 1
fi

#check step 1
INITFILE=`ps -fel | grep \./[j]boss `
if [[ $INITFILE = *$DOCUMENTUM_SHARED* ]] ; then
echo "Step 1 has not been completed. Please refer to $GUIDE. The Java Method Server is running. Please shut it down before running this patch install. Aborting."
exit 1
fi

#check step 2
INITFILE=`ps -fel | grep "\./[d]ocumentum -docbase_name $REPO" | awk {'print $21'} | awk 'NR>0 && NRif [[ $INITFILE = *$REPO* ]] ; then
echo "Step 2 has not been completed. Please refer to $GUIDE. The Repository is running. Please shut it down before running this patch install. Aborting."
exit 1
fi
gunzip $DOCUMENTUM/$PATCH.gz
if [[ -f $DOCUMENTUM/$PATCH ]] ; then
echo "file $PATCH exists"
else
echo "patch tar file, $PATCH does not exit. Please check it gunzip'ed correctly before running this script again."
exit 1
fi

if [[ $XPLORE="Y" ]] ; then
echo "Step 3. Please ensure you have stopped the Index Agent and Index Server. If not do it now. Pressing ENTER confirms your agreement. Otherwise ctrl+c to abort to rerun this script again later."
read x
fi

echo "Step 4. If you have not backed up \$DOCUMENTUM please press ctrl+c to abort to rerun this script later, otherwise press ENTER to continue";
read x

echo "Step 5a. Prerequisit for running script is that the gz patch file has been gunzip'ed. Untarring files"

tar xvf $DOCUMENTUM/$PATCH
echo "Unpacked tar. "
echo "Step 5b. Moving and copying files"
echo "Step 5b. -1. Deployment of dmldap.jar"
mv $DOCUMENTUM/dmldap.jar $DOCUMENTUM_SHARED/jboss4.3.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/APP-INF/lib/dmldap.jar
echo "Step 5b. -2. Deployment of server-impl.jar"
cp $DOCUMENTUM/server-impl.jar $DOCUMENTUM_SHARED/jboss4.3.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/APP-INF/lib/server-impl.jar
echo "Step 5b. -3. Deployment of mthdservlet.jar"
mv $DOCUMENTUM/mthdservlet.jar $DOCUMENTUM_SHARED/jboss4.3.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/DmMethods.war/WEB-INF/lib/mthdservlet.jar

#if xmlstore is configured
if [[ XML_STORE == "Y" ]] ; then
echo "Step 5c - xhiveconnector.jar"
cp $DOCUMENTUM/xhiveconnector.jar $DOCUMENTUM_SHARED/jboss4.3.0/server/DctmServer_MethodServer/deploy/XhiveConnector.ear/XhiveConnector.war/WEB-INF/lib/xhiveconnector.jar
fi

rm $DOCUMENTUM/xhiveconnector.jar

#Step 5(d) FAST is not deployed by this script but the files will be removed.
rm $DOCUMENTUM/adminagent.jar
rm $DOCUMENTUM/server-impl.jar
rm $DOCUMENTUM/libFastQueryPlugin.so
if [[ $XPLORE == "Y" ]] ; then
echo "Step 5e - deploying files for XPLORE - serverapps.ear to two locations"
cp -r $DOCUMENTUM/jboss4.3.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/APP-INF/lib/* $DOCUMENTUM_SHARED/jboss4.3.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/APP-INF/lib
cp -r $DOCUMENTUM/jboss4.3.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/DmMethods.war/WEB-INF/lib/* $DOCUMENTUM_SHARED/jboss4.3.0/server/DctmServer_MethodServer/deploy/ServerApps.ear/DmMethods.war/WEB-INF/lib
fi
echo "Creating a root file for root user to execute which will execute Step 5g"
cat << EOF >$DOCUMENTUM/run_as_root.sh
if [ "\$(id -u)" != "0" ]; then
echo "ERROR - Script should be run as root"
exit 1
fi
cp $DOCUMENTUM/product/6.7/install/external_apps/checkpass/dm_check_password $DOCUMENTUM/dba
cp $DOCUMENTUM/product/6.7/install/external_apps/assumeuser/dm_assume_user $DOCUMENTUM/dba
cp $DOCUMENTUM/product/6.7/install/external_apps/checkpass/dm_check_password $DOCUMENTUM/dba
#note the following commented out file does not exist in the bundle on page 8 of the P03 ReadMe.
#echo "cp $DOCUMENTUM/product/6.7/install/external_apps/changepass/dm_change_password $DOCUMENTUM/dba"
cp $DOCUMENTUM/product/6.7/install/external_apps/assumeuser/dm_assume_user $DOCUMENTUM/dba
$DOCUMENTUM/dba/dm_root_task << xEOF
$GROUP
o
o
o
o
o
xEOF
EOF
chmod +x $DOCUMENTUM/run_as_root.sh
cp $DOCUMENTUM/shared/dfc.jar $DOCUMENTUM_SHARED
echo "Please execute $DOCUMENTUM/run_as_root.sh as a root user before running part 2 of this script."

patch04_step2.sh

#!/bin/bash
# Patch deployment script version 1.0 for Content Server CS_6.7.0030.0232 Patch 3 - Script part 2
if [[ -z $DOCUMENTUM ]] ; then
echo "\$DOCUMENTUM NOT SET" ;
exit 1;
else
echo "\$DOCUMENTUM set";
fi

if [[ -z $DOCUMENTUM_SHARED ]] ; then
echo "\$DOCUMENTUM_SHARED NOT SET" ;
exit 1;
else
echo "\$DOCUMENTUM_SHARED set";
fi

REPO=$1
PASS=$2

if [[ "$1" == "" ]] ; then
echo "USAGE $0  "
exit 1
fi

if [[ "$2" == "" ]] ; then
echo "USAGE $0  "
exit 1
fi

REPO=$1

if [[ ! -f "$DOCUMENTUM/dba/dm_start_$REPO" ]] ; then
echo "REPOSITORY $REPO does not seem to exist. Please check repository name"
exit 1
fi

ROOT_TASK=`ls -l $DOCUMENTUM/dba/dm_check_password | awk '{ print $3 }'`
I_OWNER=`ls -l $DOCUMENTUM/install.log | awk '{ print $3 }'`

echo "root task: $ROOT_TASK"
if [[ $ROOT_TASK == "root" ]] ; then
echo "dm_check_password is owned by root (OK)"
else
echo "Looks like part 1 of this script was executed but root task step has not been executed. Quitting"
exit 1
fi

if [[ $I_OWNER == `whoami` ]] ; then
echo "patch execution by installation owner"
else
echo "You are not logged in as the installation owner. Quitting"
exit 1
fi

echo "Step 8. Starting docbroker (if required)"
$DOCUMENTUM/dba/dm_launch_Docbroker
sleep 5
echo "Step 8a. Starting docbase (if required) and waiting 60 seconds"
$DOCUMENTUM/dba/dm_start_$REPO
sleep 60
echo "Step 8b. Starting java method server (if required)"
nohup $DOCUMENTUM_SHARED/jboss4.3.0/server/startMethodServer.sh &

echo "Please ensure to start the IndexAgent and IndexServer in the case that xPlore or FAST is required. Press ENTER to confirm and continue."
read x
echo "Steps 9 and 10 - install MessagingApp and Workflow dar files. "
echo "Step 9d. Creating a temporary xml file to prepare to install dar files."
cat << EOF >$DOCUMENTUM/build.xml
<!--?xml version="1.0" encoding="UTF-8"?-->
This is the ant script code to install a dar in the docbase




EOF
echo "Step 9e. Launching dar installer"
$JAVA_HOME/bin/java -Dlogpath=/tmp/$REPO\.log -cp $DM_HOME/install/composer/ComposerHeadless/startup.jar org.eclipse.core.launcher.Main -data $DM_HOME/install/composer/workspace -application org.eclipse.ant.core.antRunner -buildfile build.xml
echo "Please check the log in /tmp/$REPO.log"

echo "Step 11. Installing lifecycle.jar"
iapi $REPO -U$I_OWNER -P -e << EOF
retrieve,c,dmc_jar where object_name = 'lifecycle.jar'
checkout,c,l
setfile,c,l,$DOCUMENTUM/lifecycle.jar
checkin,c,l
exit
EOF
status=$?

echo "EVIDENCE confirming jar has been installed follows:"
idql $REPO -U$I_OWNER -P -e << EOF
select r_modify_date, r_creation_date from dmc_jar where object_name='lifecycle.jar';
go
exit
EOF
status=$?
echo $status
echo "Step 6. This is moved to last and is just cleaning up files from the application of the patch."
rm -rf $DOCUMENTUM/jboss4.3.0
rm -rf $DOCUMENTUM/shared
if [[ -f $DOCUMENTUM/lifecycle.jar ]] ; then rm $DOCUMENTUM/lifecycle.jar ; fi
if [[ -f $DOCUMENTUM/MessagingApp.dar ]] ; then rm $DOCUMENTUM/MessagingApp.dar ; fi
if [[ -f $DOCUMENTUM/Workflow.dar ]] ; then rm $DOCUMENTUM/Workflow.dar ; fi
if [[ -f $DOCUMENTUM/mthdservlet.jar ]] ; then rm $DOCUMENTUM/mthdservlet.jar ; fi
if [[ -f $DOCUMENTUM/dmldap.jar ]] ; then rm $DOCUMENTUM/dmldap.jar ; fi
if [[ -f $DOCUMENTUM/build.xml ]] ; then rm $DOCUMENTUM/build.xml ; fi
if [[ -f $DOCUMENTUM/server-impl.jar ]] ; then rm $DOCUMENTUM/server-impl.jar ; fi
if [[ -f $DOCUMENTUM/xhiveconnector.jar ]] ; then rm $DOCUMENTUM/xhiveconnector.jar ; fi
if [[ -f $DOCUMENTUM/adminagent.jar ]] ; then rm $DOCUMENTUM/adminagent.jar ; fi
if [[ -f $DOCUMENTUM/run_as_root.sh ]] ; then rm $DOCUMENTUM/run_as_root.sh ; fi

echo "Please refer to the patch documentation technical notes and any final deployment tasks. This automation is complete."

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.