Changes for page Killing WOA Processes

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

From version 2.1
edited by smmccraw
on 2007/07/08 09:45
Change comment: There is no comment for this version
To version 3.1
edited by Pascal Robert
on 2010/09/13 00:09
Change comment: There is no comment for this version

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Programming__WebObjects-Web Applications-Deployment-Killing WOA Processes
1 +Deployment-Killing WOA Processes
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.smmccraw
1 +XWiki.probert
Content
... ... @@ -1,54 +1,54 @@
1 1  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.
2 2  
3 -Try to use lsof. You need to run it with admin privileges so the command is
3 +Try to use lsof. You need to run it with admin privileges so the command is
4 4  
5 -{{panel}}
5 +{{noformat}}
6 6  
7 - sudo lsof -i tcp:xxxx
7 +sudo lsof -i tcp:xxxx
8 8  
9 -{{/panel}}
9 +{{/noformat}}
10 10  
11 11  Alternatively you can have a script:
12 12  
13 -{{panel}}
13 +{{code}}
14 14  
15 - #!/bin/sh
16 - #
17 - # portslay: kill the task listening on the specified TCP port
18 - #
19 - kill -9 `lsof -i tcp:$1 | grep LISTEN | awk '{ print $2;}'`
15 + #!/bin/sh
16 + #
17 + # portslay: kill the task listening on the specified TCP port
18 + #
19 + kill -9 `lsof -i tcp:$1 | grep LISTEN | awk '{ print $2;}'`
20 20  
21 -{{/panel}}
21 +{{/code}}
22 22  
23 23  You will also have to do a sudo for the script to run.
24 24  
25 25  For those stuck with the CLOSE//WAIT problems try this~://
26 26  
27 -{{panel}}
27 +{{noformat}}
28 28  
29 - sudo lsof -i tcp:xxxx
29 +sudo lsof -i tcp:xxxx
30 30  
31 -{{/panel}}
31 +{{/noformat}}
32 32  
33 33  Alternatively you can have a script:
34 34  
35 -{{panel}}
35 +{{code}}
36 36  
37 - #!/bin/sh
38 - #
39 - # portslay: kill the task listening on the specified TCP port
40 - #
41 - kill -9 `lsof -i tcp:$1 | grep CLOSE_WAIT | awk '{ print $2;}'`
37 + #!/bin/sh
38 + #
39 + # portslay: kill the task listening on the specified TCP port
40 + #
41 + kill -9 `lsof -i tcp:$1 | grep CLOSE_WAIT | awk '{ print $2;}'`
42 42  
43 -{{/panel}}
43 +{{/code}}
44 44  
45 45  run it by doing:
46 46  
47 -{{panel}}
47 +{{noformat}}
48 48  
49 - sudo ./portslay xxxx-yyyy
49 +sudo ./portslay xxxx-yyyy
50 50  
51 -{{/panel}}
51 +{{/noformat}}
52 52  
53 53  where xxxx is the first port and yyyy the last port
54 54  
... ... @@ -56,18 +56,25 @@
56 56  
57 57  how about (pref. inside a script):
58 58  
59 -ps aux | grep java | grep <appName> | grep --v grep | awk '{ print"kill --9 "$2 }' | sh
59 +{{noformat}}
60 60  
61 -=== Mike Schrag ===
61 +ps aux | grep java | grep <appName> | grep -v grep | awk '{ print"kill -9 "$2 }' | sh
62 62  
63 +{{/noformat}}
64 +
65 +\\
66 +
67 +=== Mike Schrag ===
68 +
63 63  I just use
64 64  
65 -{{panel}}
71 +{{noformat}}
66 66  
67 - ps auxww
73 +ps auxww
68 68  
69 -{{/panel}}
70 70  
76 +{{/noformat}}
77 +
71 71  which will show the full commandline. You can see the app name from this view.
72 72  
73 73  === Fabian Peters ===
... ... @@ -74,19 +74,19 @@
74 74  
75 75  On FreeBSD one needs to set
76 76  
77 -{{panel}}
84 +{{noformat}}
78 78  
79 - kern.ps_arg_cache_limit=1024
86 +kern.ps_arg_cache_limit=1024
80 80  
81 -{{/panel}}
88 +{{/noformat}}
82 82  
83 -in /etc/sysctl to reveal the full command line with ps --auxww. To set it immediately:--
90 +in /etc/sysctl to reveal the full command line with ps auxww. To set it immediately:
84 84  
85 -{{panel}}
92 +{{noformat}}
86 86  
87 - sysctl kern.ps_arg_cache_limit=1024
94 +sysctl kern.ps_arg_cache_limit=1024
88 88  
89 -{{/panel}}
96 +{{/noformat}}
90 90  
91 91  Alternatively, one can use Johan's script below.
92 92  
... ... @@ -99,7 +99,6 @@
99 99  #!/bin/sh
100 100  
101 101  if [ $# = 0 ]; then
102 -{panel}
103 103   echo ""
104 104   echo " usage: $0 javaname(s)"
105 105   echo " The current processes that containt javaname will be displayed"
... ... @@ -106,7 +106,6 @@
106 106   echo " eg: $0 JavaMonitor.woa"
107 107   echo ""
108 108   exit 1
109 -{panel}
110 110  fi
111 111  
112 112  OS=`uname -s`
... ... @@ -133,5 +133,3 @@
133 133  done
134 134  
135 135  {{/code}}
136 -
137 -Category:WebObjects