
Ashok, Thanks for the info. I had tried that but what I got was a list of processes like so. 1272 5785 5791 Problem is that I need to associated the pid to individual process (gotten from Runtime.getRuntime().exec("gksu rfcomm connect 0 0B:D4:91:39:66:01");) in the java app. Now since I am using Threading ie. the Runtime.getRuntime().exec(" gksu rfcomm connect 0 0B:D4:91:39:66:01"); is being called within a thread many times for the different array of devices that I have set on my machine I have to make sure I do not kill a process that has not completed its task. Its not possible to determine the execution order of threads so I need the calling thread to retrieve its own pid assicaited with invoked runtime process. I think I might just use some shell scripts and call them from within java then try retrieve the shell scripts from with the java code. (Messy stuff :-( ) On 6 July 2010 11:06, Ashok Hariharan <ashok@parliaments.info> wrote:
On Tue, Jul 6, 2010 at 12:51 AM, Geoffrey Mimano <soyfactor@gmail.com> wrote:
gksu rfcomm connect 0 0B:D4:91:39:66:01
They are not matching because the jvm invokes its own shell starts up rfcomm and returns and I am guessing this rfcomm command runs 'headless' in the main os shell.
so what you need to do is get the process id of the running rfcomm :
the output of this shell command should give you the real process id of the rfcomm process .
"ps ax | grep 'rfcomm' | awk '{print $1}' "
which you can then you to send a kill signal... _______________________________________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks ------------ Skunkworks Server donations spreadsheet
http://spreadsheets.google.com/ccc?key=0AopdHkqSqKL-dHlQVTMxU1VBdU1BSWJxdy1f... ------------ Skunkworks Rules http://my.co.ke/phpbb/viewtopic.php?f=24&t=94 ------------ Other services @ http://my.co.ke
-- Mimano G. Muthondu, Software Developer skype : gmimano Mobile : +254 723 615 206