Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


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

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

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.

Old 08-24-2009, 03:58 AM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.3, Oracle Linux, Mint
Posts: 9,695

Rep: Reputation: 408Reputation: 408Reputation: 408Reputation: 408Reputation: 408
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, 07:28 AM   #3
LQ Guru
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190Reputation: 1190
I have a similar answer to the one I gave when I apparently misunderstood your question the previous time you asked:
(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 07:29 AM.


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 10 05-13-2016 03:20 PM
[SOLVED] process status ak.lokesh Linux - Newbie 2 01-21-2011 02:44 PM
update-status Process? Harpo SUSE / openSUSE 3 02-04-2009 11:22 AM
Getting a child process status (C) smoothdogg00 Programming 2 04-29-2006 11:49 AM
how to get process status using pid? hongxing Linux - Software 2 04-11-2006 07:11 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:27 PM.

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