Programming__WebObjects-Web Applications-Deployment-Killing WOA Processes

Version 2.1 by smmccraw on 2007/07/08 09:45

This is one of the most vexing question. How to kill a run away WO application? The ps command does not give you any information as it list the process as java.

Try to use lsof. You need to run it with admin privileges so the command is 

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

Alternatively you can have a script:

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

You will also have to do a sudo for the script to run.

For those stuck with the CLOSEWAIT problems try this:

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

Alternatively you can have a script:

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

run it by doing:

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

where xxxx is the first port and yyyy the last port


how about (pref. inside a script):

ps aux | grep java | grep <appName> | grep v grep | awk '{ print"kill 9 "$2 }' | sh

Mike Schrag

I just use

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

which will show the full commandline.  You can see the app name from this view.

Fabian Peters

On FreeBSD one needs to set

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

in /etc/sysctl to reveal the full command line with ps auxww. To set it immediately:

Error

There is no valid license for Pro Macros. Please visit the Licenses section.

Alternatively, one can use Johan's script below.

Johan Henselmans

I have written a small script that uses lsof to find the process by looking at some specific file that is opened, the returned processes can then be used to kill the process


#!/bin/sh

if [ $# = 0 ]; then
{panel}
       echo ""
       echo "   usage: $0 javaname(s)"
       echo "   The current processes that  containt javaname will be displayed"
       echo "   eg: $0 JavaMonitor.woa"
       echo ""
       exit 1
{panel}
fi

OS=`uname -s`
# echo $OS
case  ${OS} in
'FreeBSD')
LSOF=/usr/local/sbin/lsof
;;
'Linux')
LSOF=/usr/sbin/lsof
;;
'Darwin')
LSOF=/usr/sbin/lsof
;;
*)
echo "no lsof command available on this OS!";
exit 1
;;
esac

for i in $*
do
${LSOF} -c java | grep -i $i | awk '{print $2}' | sort -u;
done

Category:WebObjects