On 14.09.2006, at 19:50, Vlad Seryakov wrote:
The only immediate request i would have for ns_proxy to be able to
query
pid for active proxies, may be ns_proxy active could return pid or
other
command, that will be useful for forcing process exit if necessary.
You can do:
ns_proxy clear ?pool?
to forcefully clear _all_ slave processes (or just
ones for the given pool).
But look here:
server1:nscp 1> set proxy [ns_proxy get pool]
zvpb:~ zoran$ ps -ax | grep proxy
13423 p0 S+ 0:00.02 /usr/local/ns/bin/nsproxy pool pool-7
13425 p2 S+ 0:00.01 grep proxy
Now we have a slave process running. So:
server1:nscp 2> ns_proxy send $proxy "exec sleep 10000"
server1:nscp 3> ns_proxy wait $proxy 1000
could not wait for proxy "pool-7": timeout waiting for evaluation
zvpb:~ zoran$ ps -ax | grep proxy
13423 p0 S+ 0:00.02 /usr/local/ns/bin/nsproxy pool pool-7 {exec
sleep 10000}
Now you have the slave "gone wild". How to get rid
of it? Simply:
server1:nscp 4> ns_proxy put $proxy
and hopla:
[14/Sep/2006:19:58:11][13419.41968128][-nsproxy:reap-] Warning:
[pool]: pid 13423 won't die, send signal 15
[14/Sep/2006:19:58:12][13419.41968128][-nsproxy:reap-] Error: process
13423 killed with signal 15 (Terminated)
and:
zvpb:~ zoran$ ps -ax | grep proxy
13430 p2 R+ 0:00.00 grep proxy
This is NEW in the code. If your proxy is just taking too
much time, you return it back to the pool. The code will
see that you are returning an non-idle proxy back to pool
and will assure to kill the slave.
Is this what you are looking for?
Cheers,
Zoran