AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
Expand all | Collapse all

Script to stop/start WebSphere with PID validation

  • 1.  Script to stop/start WebSphere with PID validation

    Posted Mon January 20, 2014 04:30 AM

    Originally posted by: zieggy


    Hi,

     

    Could somebody help me create a script, that will stop/start WebSphere services which will validate first if running via checking its PID running before killing its PID.

     

    Thanks

     

    This is our manual procedure to stop/start WebSphere

     

    To Stop WAS Node 1

    (use root)

    ps -ef | grep node

    get PID of nodeagent

    kill -9 <PID of nodeagent>

    ps -ef | grep server1

    get PID of server1

    kill -9 <PID of server1>

     

     

    Example:

     

    ps -ef | grep node

        root  1234567        1   0   Nov 21  pts/0  7:30 /test/IBM/WebSphere/AppServer/java/bin/java -Xmaxt0.5 -Dwas.status.socket=41679 -Declipse.security -Dosgi.install.area=/test/IBM/WebSphere/AppServer -Dosgi.configuration.area=/test/wasprofiles/TEST/configuration -Dosgi.framework.extensions=com.ibm.cds,com.ibm.ws.eclipse.adaptors -Xshareclasses:name=webspherev70_%g,groupAccess,nonFatal -Xscmx50M -Xbootclasspath/p:/test/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/test/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmext.jar -classpath /test/wasprofiles/TEST/properties:/test/IBM/WebSphere/AppServer/properties:/test/IBM/WebSphere/AppServer/lib/startup.jar:/test/IBM/WebSphere/AppServer/lib/bootstrap.jar:/test/IBM/WebSphere/AppServer/lib/jsf-nls.jar:/test/IBM/WebSphere/AppServer/lib/lmproxy.jar:/test/IBM/WebSphere/AppServer/lib/urlprotocols.jar:/test/IBM/WebSphere/AppServer/deploytool/itp/batchboot.jar:/test/IBM/WebSphere/AppServer/deploytool/itp/batch2.jar:/test/IBM/WebSphere/AppServer/java/lib/tools.jar -Dibm.websphere.internalClassAccessMode=allow -Xms50m -Xmx256m -Xcompressedrefs -Dws.ext.dirs=/test/IBM/WebSphere/AppServer/java/lib:/test/wasprofiles/TEST/classes:/test/IBM/WebSphere/AppServer/classes:/test/IBM/WebSphere/AppServer/lib:/test/IBM/WebSphere/AppServer/installedChannels:/test/IBM/WebSphere/AppServer/lib/ext:/test/IBM/WebSphere/AppServer/web/help:/test/IBM/WebSphere/AppServer/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime -Dderby.system.home=/test/IBM/WebSphere/AppServer/derby -Dcom.ibm.itp.location=/test/IBM/WebSphere/AppServer/bin -Djava.util.logging.configureByServer=true -Duser.install.root=/test/wasprofiles/TEST -Djavax.management.builder.initial=com.ibm.ws.management.PlatformMBeanServerBuilder -Dwas.install.root=/test/IBM/WebSphere/AppServer -Dpython.cachedir=/test/wasprofiles/TEST/temp/cachedir -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager -Dserver.root=/test/wasprofiles/TEST -Dcom.ibm.security.jgss.debug=off -Dcom.ibm.security.krb5.Krb5Debug=off -Djava.awt.headless=true -Djava.security.auth.login.config=/test/wasprofiles/TEST/properties/wsjaas.conf -Djava.security.policy=/test/wasprofiles/TEST/properties/server.policy com.ibm.wsspi.bootstrap.WSPreLauncher -nosplash -application com.ibm.ws.bootstrap.WSLauncher com.ibm.ws.runtime.WsServer /test/wasprofiles/TEST/config TESTDmgrCell TESTNode01 nodeagent

     

    kill -9 1234567

    ps -ef | grep server1

     root 4444333       1   8   Nov 21  pts/0 97:45 /test/IBM/WebSphere/AppServer/java/bin/java -Declipse.security -Dwas.status.socket=41743 -Dosgi.install.area=/test/IBM/WebSphere/AppServer -Dosgi.configuration.area=/test/wasprofiles/TEST/configuration -Djava.awt.headless=true -Dosgi.framework.extensions=com.ibm.cds,com.ibm.ws.eclipse.adaptors -Xshareclasses:name=webspherev70_%g,groupAccess,nonFatal -Xscmx50M -Xbootclasspath/p:/test/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmorb.jar:/test/IBM/WebSphere/AppServer/java/jre/lib/ext/ibmext.jar -classpath /test/wasprofiles/TEST/properties:/test/IBM/WebSphere/AppServer/properties:/test/IBM/WebSphere/AppServer/lib/startup.jar:/test/IBM/WebSphere/AppServer/lib/bootstrap.jar:/test/IBM/WebSphere/AppServer/lib/jsf-nls.jar:/test/IBM/WebSphere/AppServer/lib/lmproxy.jar:/test/IBM/WebSphere/AppServer/lib/urlprotocols.jar:/test/IBM/WebSphere/AppServer/deploytool/itp/batchboot.jar:/test/IBM/WebSphere/AppServer/deploytool/itp/batch2.jar:/test/IBM/WebSphere/AppServer/java/lib/tools.jar -Dibm.websphere.internalClassAccessMode=allow -Xcompressedrefs -Dws.ext.dirs=/test/IBM/WebSphere/AppServer/java/lib:/test/wasprofiles/TEST/classes:/test/IBM/WebSphere/AppServer/classes:/test/IBM/WebSphere/AppServer/lib:/test/IBM/WebSphere/AppServer/installedChannels:/test/IBM/WebSphere/AppServer/lib/ext:/test/IBM/WebSphere/AppServer/web/help:/test/IBM/WebSphere/AppServer/deploytool/itp/plugins/com.ibm.etools.ejbdeploy/runtime -Dderby.system.home=/test/IBM/WebSphere/AppServer/derby -Dcom.ibm.itp.location=/test/IBM/WebSphere/AppServer/bin -Djava.util.logging.configureByServer=true -Duser.install.root=/test/wasprofiles/TEST -Djavax.management.builder.initial=com.ibm.ws.management.PlatformMBeanServerBuilder -Dwas.install.root=/test/IBM/WebSphere/AppServer -Dpython.cachedir=/test/wasprofiles/TEST/temp/cachedir -Djava.util.logging.manager=com.ibm.ws.bootstrap.WsLogManager -Dserver.root=/test/wasprofiles/TEST -Dcom.ibm.security.jgss.debug=off -Dcom.ibm.security.krb5.Krb5Debug=off -Xgcpolicy:gencon -Xmx2g -Xms2g -Xmn1000m -Xnoloa -Djava.security.auth.login.config=/test/wasprofiles/TEST/properties/wsjaas.conf -Djava.security.policy=/test/wasprofiles/TEST/properties/server.policy com.ibm.wsspi.bootstrap.WSPreLauncher -nosplash -application com.ibm.ws.bootstrap.WSLauncher com.ibm.ws.runtime.WsServer /test/wasprofiles/TEST/config TESTDmgrCell TESTNode01 server1

     

    kill -9 4444333



  • 2.  Re: Script to stop/start WebSphere with PID validation

    Posted Mon January 20, 2014 05:24 PM

    Originally posted by: GarlandJoseph


    This is not the recommended way to stop websphere.   Why aren't you using the start and stop script for websphere.   Also, it isn't advisable to run the -9 switch it doesn't allow for a graceful process end.

    The pid for the runng websphere / application servers may be in a file.   Have you tried using kill without the -9 swith?  Have you checked to insure that when you kill -9 these processes that you're not creating zombies of orphans.  Use the proctree command to confirm this (always kill without the -9 switch first). Or use this if proctree isn't available to see a process tree COLUMN=132 ps fT <pid>

    Also if you are going to do a ps -aef | grep "something"...always do a ps -aef | grep "something"  | grep -v grep to weed out the grep command

     



  • 3.  Re: Script to stop/start WebSphere with PID validation

    Posted Mon January 20, 2014 06:48 PM

    Originally posted by: zieggy


    Thanks GarlandJoseph,

    Yes I do understand that this is not a standard procedure, we do good in PROD, but i badly needed the script in our Test environment.