LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 08-24-2009, 04:20 AM   #1
sivareddy_jntu
LQ Newbie
 
Registered: Jun 2009
Posts: 6

Rep: Reputation: 0
How to know a process status by it's ID


hai,
I have a java program,in which i need to know another process status.But that process is not subprocess of java program.How can i do this.

Any help would be appreciated highly.


Thanks,
siva.
 
Old 08-24-2009, 04:58 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,523

Rep: Reputation: 365Reputation: 365Reputation: 365Reputation: 365
I'm afraid you can do it with (pure) java. Of course, you can call native methods and/or run external programs from java to achieve the same.
 
Old 08-24-2009, 08:28 AM   #3
johnsfine
Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,142

Rep: Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127Reputation: 1127
I have a similar answer to the one I gave when I apparently misunderstood your question the previous time you asked:
http://www.linuxquestions.org/questi...18#post3652318
(on rereading that thread, I don't know why I thought you wanted the calling program's own pid.)

But instead of /proc/self use /proc/PID replacing PID with the numeric pid of the process you want.

You can read files with ordinary java, so you don't need any native methods, external programs or special API. Of course the results will be fairly OS specific, but I expect any method of getting process status would give OS specific results.

Last edited by johnsfine; 08-24-2009 at 08:29 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Process Status D webee Linux - General 8 02-11-2013 01:12 PM
[SOLVED] process status ak.lokesh Linux - Newbie 2 01-21-2011 03:44 PM
update-status Process? Harpo Suse/Novell 3 02-04-2009 12:22 PM
Getting a child process status (C) smoothdogg00 Programming 2 04-29-2006 12:49 PM
how to get process status using pid? hongxing Linux - Software 2 04-11-2006 08:11 AM


All times are GMT -5. The time now is 12:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration