LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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, 03: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, 03:58 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
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 07:29 AM.
 
  


Reply



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 12 07-08-2019 04:03 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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:27 AM.

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
Open Source Consulting | Domain Registration