Killing WOA Processes

Last modified by David Avendasora on 2010/11/30 06:45

This is one of the most vexing question. How to kill a runaway WebObjects application? The ps command does not give you any information as it lists the process simply as java.

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

Unknown macro: noformat. Click on this message for details.

Alternatively you can have a script:


 #!/bin/sh
#
#  portslay:  kill the task listening on the specified TCP port
#
kill -9 `lsof -i tcp:$1 | grep LISTEN | awk '{ print $2;}'`

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

For those stuck with the CLOSE_WAIT problems try this:

Unknown macro: noformat. Click on this message for details.

Alternatively you can have a script:


 #!/bin/sh
#
#  portslay:  kill the task listening on the specified TCP port
#
kill -9 `lsof -i tcp:$1 | grep CLOSE_WAIT | awk '{ print $2;}'`

run it by doing:

Unknown macro: noformat. Click on this message for details.

where xxxx is the first port and yyyy the last port


how about (pref. inside a script):

Unknown macro: noformat. Click on this message for details.


Mike Schrag

I just use

Unknown macro: noformat. Click on this message for details.

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

Fabian Peters

On FreeBSD one needs to set

Unknown macro: noformat. Click on this message for details.

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

Unknown macro: noformat. Click on this message for details.

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
       echo ""
       echo "   usage: $0 javaname(s)"
       echo "   The current processes that  containt javaname will be displayed"
       echo "   eg: $0 JavaMonitor.woa"
       echo ""
       exit 1
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