[99833] in RedHat Linux List
RE: getting the PID just spawned
daemon@ATHENA.MIT.EDU (Charles Galpin)
Tue Nov 17 09:17:39 1998
Date: Tue, 17 Nov 1998 09:18:06 -0500
From: Charles Galpin <cgalpin@lighthouse-software.com>
To: Justin Kuntz <redhat-list@redhat.com>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
As far as I know, there is no way to get the PID in Java. I guess that's
what you get for trying to support the lowest common denominator ( which you
have to do if you want to be cross platform)
A possible solution could be to write a script that calls your command and
saves the pid to a file whose name is well known, or derived from the script
name, so you could then open it from your Java code.
hth
charles
===== Original Message from Justin Kuntz <redhat-list@redhat.com> at
11/17/98 8:39 am
<snip>
>I would like to know how to get the exitValue of the spawned process to be
>equal to the Process ID that was just assigned.
>
>For example, say I issue a command like:
>command = "/usr/sbin/named -b /var/named/internal/named.boot"
>
>I would like for my p.exitValue() call to equal the PID that I just
>spawned. The reason I am asking this question in the forum is because I
>know there are a lot of shell programming experts here... and really all my
>program is doing is issuing a shell command and looking at the return
>value.
>
>Thanks,
>
>Justin
-- Charles Galpin <cgalpin@lighthouse-software.com>
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.