Changes for page Killing WOA Processes

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

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

Summary

Details

Page properties
Title
... ... @@ -1,1 +1,1 @@
1 -Deployment-Killing WOA Processes
1 +Programming__WebObjects-Web Applications-Deployment-Killing WOA Processes
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.probert
1 +XWiki.smmccraw
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 -{{noformat}}
5 +{{panel}}
6 6  
7 -sudo lsof -i tcp:xxxx
7 + sudo lsof -i tcp:xxxx
8 8  
9 -{{/noformat}}
9 +{{/panel}}
10 10  
11 11  Alternatively you can have a script:
12 12  
13 -{{code}}
13 +{{panel}}
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 -{{/code}}
21 +{{/panel}}
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 -{{noformat}}
27 +{{panel}}
28 28  
29 -sudo lsof -i tcp:xxxx
29 + sudo lsof -i tcp:xxxx
30 30  
31 -{{/noformat}}
31 +{{/panel}}
32 32  
33 33  Alternatively you can have a script:
34 34  
35 -{{code}}
35 +{{panel}}
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 -{{/code}}
43 +{{/panel}}
44 44  
45 45  run it by doing:
46 46  
47 -{{noformat}}
47 +{{panel}}
48 48  
49 -sudo ./portslay xxxx-yyyy
49 + sudo ./portslay xxxx-yyyy
50 50  
51 -{{/noformat}}
51 +{{/panel}}
52 52  
53 53  where xxxx is the first port and yyyy the last port
54 54  
... ... @@ -56,25 +56,18 @@
56 56  
57 57  how about (pref. inside a script):
58 58  
59 -{{noformat}}
59 +ps aux | grep java | grep <appName> | grep --v grep | awk '{ print"kill --9 "$2 }' | sh
60 60  
61 -ps aux | grep java | grep <appName> | grep -v grep | awk '{ print"kill -9 "$2 }' | sh
61 +=== Mike Schrag ===
62 62  
63 -{{/noformat}}
64 -
65 -\\
66 -
67 -=== Mike Schrag ===
68 -
69 69  I just use
70 70  
71 -{{noformat}}
65 +{{panel}}
72 72  
73 -ps auxww
67 + ps auxww
74 74  
69 +{{/panel}}
75 75  
76 -{{/noformat}}
77 -
78 78  which will show the full commandline. You can see the app name from this view.
79 79  
80 80  === Fabian Peters ===
... ... @@ -81,19 +81,19 @@
81 81  
82 82  On FreeBSD one needs to set
83 83  
84 -{{noformat}}
77 +{{panel}}
85 85  
86 -kern.ps_arg_cache_limit=1024
79 + kern.ps_arg_cache_limit=1024
87 87  
88 -{{/noformat}}
81 +{{/panel}}
89 89  
90 -in /etc/sysctl to reveal the full command line with ps auxww. To set it immediately:
83 +in /etc/sysctl to reveal the full command line with ps --auxww. To set it immediately:--
91 91  
92 -{{noformat}}
85 +{{panel}}
93 93  
94 -sysctl kern.ps_arg_cache_limit=1024
87 + sysctl kern.ps_arg_cache_limit=1024
95 95  
96 -{{/noformat}}
89 +{{/panel}}
97 97  
98 98  Alternatively, one can use Johan's script below.
99 99  
... ... @@ -106,6 +106,7 @@
106 106  #!/bin/sh
107 107  
108 108  if [ $# = 0 ]; then
102 +{panel}
109 109   echo ""
110 110   echo " usage: $0 javaname(s)"
111 111   echo " The current processes that containt javaname will be displayed"
... ... @@ -112,6 +112,7 @@
112 112   echo " eg: $0 JavaMonitor.woa"
113 113   echo ""
114 114   exit 1
109 +{panel}
115 115  fi
116 116  
117 117  OS=`uname -s`
... ... @@ -138,3 +138,5 @@
138 138  done
139 139  
140 140  {{/code}}
136 +
137 +Category:WebObjects