PROCEDURE:
VALIDATE ALL SERVICES ARE DOWN
ps -ef | grep -i java && ps -ef | grep -i methods && ps -ef | grep -i index
# If they are running !! stop them
1) stop index services(index stop script) && ps -ef | grep -i index
2) Stop methods (method stop script)&& Ps -ef | grep i java
RESTART THE SERVICES (IN THIS ORDER)
1)Restart Methods (on the background to see if its running) && tail -f nohup.out (for result)
2) Restart index in the same order
Click <Start Stop Methods& Index service: Full Script> Thank you
FULL SCRIPT
###################################################################################################################### #!/bin/bash ################################################################## #program : start_stop_dcbase_method_webcache.sh_2018 # : Date, 7/14/2017 # : Fwere # : documentum script ##################################################################
# chkconfig: 345 20 10 # Startup and Shutdown Documentum # Oracle database must be started BEFORE starting Documentum
###########################################################################################
#---------------------------------------------------------------------------------------------------------------------- DOCBASE_NAME=`cat /app/documentum/dba/config/*/server.ini | grep -i docbase_name | awk '{print $3}'` #docbasename DOCBASE_VERSION=`cat /app/documentum/dba/config/*/server.ini | grep -i version | awk '{print $3}'` # version LUNCH_DOCKBASE=`locate dm_launch_Docbroker` ############################################################################################################### #-------------------------------------------------------------------
set -x EXPLORE_SHARE="`ls /app/documentum| grep -E 'share|xPlore'`" JBOSSQUERY="`ls /app/documentum/$EXPLORE_SHARE/ | grep -E 'jboss|wildfly' | grep -v old | sort -rg |awk 'FNR==1{print $1}'`" JBOSS_DIR="/app/documentum/$EXPLORE_SHARE/$JBOSSQUERY" #--------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------- METHODS_STARTUP_SCRIPT=`ls $JBOSS_DIR/server/ | grep -i start*Method*` METHODS_STOP_SCRIPT=`ls $JBOSS_DIR/server/ | grep -i stop*Method*` #------------------------------------------------------------------------------------------- #--------------------------------------------------------------------------------------------- WEBCACHE_STARTUP_SCRIPT="`ls $JBOSS_DIR/server/ | grep -i start*WEB*`" WEBCACHE_STOP_SCRIPT="`ls $JBOSS_DIR/server/ | grep -i stop*WEB*`" #---------------------------------------------------------------------------------------------------- #------------------------------------------------------------------------------------------------------ #################################################################################################################
start() {
cd /app/documentum/dba &&
echo "dealing with docBroker" Docbroker="`locate dm_launch_Docbroker`" echo $Docbroker && if [[ -z "$Docbroker" ]] 2>/dev/null; then echo "Blank Missing Docbroker Script"; else echo "Docbroker Script Found Restarting IT... " echo "STATING DocBroker:"; cd /app/documentum/dba; ./dm_launch_Docbroker; sleep 5; echo "OK : DocBroker started successfully"; fi
echo "*****************************************************************************************" echo " ****************************************************************************************" echo "STATING DocBroker:" ./dm_launch_DocBroker; sleep 5; echo creating docbase arrays echo "**********************************************************************************************" echo "**********************************************************************************************" old_IFS=$IFS IFS=$'\n' DocbaseArray=($(cat /app/documentum/dba/config/*/server.ini | grep -i docbase_name | cut -d'=' -f2)) IFS=$old_IFS echo " Tsting Startup scripts for docbase" echo ${DocbaseArray[@]} && STARTSCRIPT=($(for i in "${DocbaseArray[@]}"; do ls | grep -i $i| grep -i "start"|grep -v .bak; done)) echo ${STARTSCRIPT[@]} && len=${#STARTSCRIPT[*]}
for (( i=0; i<${len}; i++ )); do echo "${STARTSCRIPT[$i]}"; echo "TESTING:" "${STARTSCRIPT[$i]}";sleep 5; echo "Starting Docbase:"; ./"${STARTSCRIPT[$i]}";sleep 5; done ############################################################################################################################################# until grep -q "Detected during program initialization: Agent Exec connected to server" "/app/documentum/dba/log/$DOCBASE_NAME.log"; do sleep 15; done -------------------------------------------------------------------------------------------------------------------------------------------
echo "Starting method Service" cd $JBOSS_DIR/server; mv nohup.out nohup.bak if [[ -z "$METHODS_STARTUP_SCRIPT" ]] 2>/dev/null; then echo "Blank Missing methods Script"; else echo "Method Script Found Restarting Method Process " cd $JBOSS_DIR/server; nohup ./$METHODS_STARTUP_SCRIPT & echo "OK : Methods Process started successfully" sleep 15; fi
echo "*********************************************************" echo "Starting Webcache Server " if [[ -z "$WEBCACHE_STARTUP_SCRIPT" ]] 2>/dev/null; then echo "Webcache script missing Nothing to do" echo "Skipping to next script"
else echo "Webscript files Exist ...Restarting Webcache process " cd $JBOSS_DIR/server; nohup ./$WEBCACHE_STARTUP_SCRIPT & echo "OK:" sleep 15; echo "OK: Webcache service Started successfully" fi
# ESP will start services on other associated servers as needed/requested. Write the temp file that ESP is looking for touch $MARKER_FILE # Breakpoint check echo "INFO: Created ESP marker file" echo "OK" ps -ef | grep -E 'DCGDOCQ|DEPIDOCQ|FUEDOCQ|NOTEDOCQ' }
stop() {
echo "Stopping documentum Webcache & methods Process " echo "Shutting Down DocBroker"; ./dm_stop_DocBroker; sleep 5; echo "Shutting down webcache process....." echo "**************************************************"
if [[ -z "$WEBCACHE_STOP_SCRIPT" ]] 2>/dev/null; then echo "EMPTY String Webcache script missing.... skipping ............" else echo "Webcache script exist...Stopping Webcache Service Now "; cd $JBOSS_DIR/server; ./$WEBCACHE_STOP_SCRIPT echo "OK:" sleep 15; echo "OK: Webcache service Stopped successfully" fi
echo "Stopping Method Service process...." echo "************************************************************" if [[ -z "$METHODS_STOP_SCRIPT" ]] 2>/dev/null; then echo "Empty String Webcache script missing ... skipping ....." else echo "Methods script exist Stopping method process Now ..."; cd $JBOSS_DIR/server; ./$METHODS_STOP_SCRIPT echo "OK:" sleep 15; echo "OK: Methods service Stopped successfully" fi echo "*****************************************************************************************" echo " ****************************************************************************************" echo "Testing Docbase Shutdown!!!!!!" DocbrokerShutdown="`locate dm_stop_Docbroker`" echo $DocbrokerShutdown && if [[ -z "$DocbrokerShutdown" ]] 2>/dev/null; then echo "Blank Missing DocbrokerShutdown Script"; else echo "DocbrokerShutdown Script Found Stopping IT... " echo "Shutting DocbrokerShutdown:"; cd /app/documentum/dba; ./dm_stop_Docbroker; sleep 5; echo "OK : DocBroker started successfully"; fi echo "**********************************************************************************************" echo "**********************************************************************************************" STOPSCRIPT=($(for i in "${DocbaseArray[@]}"; do ls | grep -i $i| grep -i "shutdown"|grep -v .bak; done)) echo ${STOPSCRIPT[@]} && len=${#STOPSCRIPT[*]} for (( i=0; i<${len}; i++ )); do
echo "${STOPSCRIPT[$i]}"; echo "TESTING" "${STOPSCRIPT[$i]}"; sleep 5; echo "Shutting Down Docbases"; ./"${STOPSCRIPT[$i]}"; sleep 5; echo " Shutdown test completed !!!" echo "**********************************************************************************************" ps -ef | grep -E 'DCGDOCQ|DEPIDOCQ|FUEDOCQ|NOTEDOCQ' done }
case "$1" in
start) start ;; stop) stop ;; reload|restart) $0 stop $0 start ;; *) #echo "Usage: /etc/init.d/tornado-tts {start|stop|restart}" echo "Usage: $0 start|stop|restart|reload" exit 1 esac exit 0 ###############################################################################################