🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2022

Re: Problem terminate started process with the Runtime class

#2022
From: John McGrath TeamB
Date: Tue, 26 Jun 2001 07:06
30 lines
1896 bytes
On Mon, 25 Jun 2001 20:00:44 +0200, Kristian wrote:

> proc = Runtime.getRuntime().exec(new String[] {
>     "tcsh", "-c", executableFile + " " + cfgFile + " >>&.logfile"});
> // Contiously read the logfile in a separate thread
> ....
> // When finished, try to destroy the process:
> proc.destroy();
> 
> But the server process will not terminate...But this isn't a
> surprise because the only process that terminates is the tcshell.

You actually have terminated the process that you created with 
Runtime.exec().  You are starting "tcsh", and that is what you
are killing.  But "tcsh" has created a subprocess, and that is
the process that you want to be killed.

You may be able to configure tcsh to kill its child processes when
it is killed.  Or you could run the executable from the Java code.
If you do that, you will have to capture the output in the Java code
and write it to the log file.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.15a1e4a7ab72707c98a2dc@forums.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews
References: <3b377c03_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,83b38d347febae6b
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-06-26 00:07:24 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: Problem terminate started process with the Runtime class 
Date: Tue, 26 Jun 2001 03:06:38 -0400
Message-ID: <MPG.15a1e4a7ab72707c98a2dc@forums.borland.com>
References: <3b377c03_1@dnews>
X-Newsreader: MicroPlanet Gravity v2.30
NNTP-Posting-Host: 209.92.40.60
X-Trace: dnews 993539197 209.92.40.60 (26 Jun 2001 00:06:37 -0700)
Lines: 30
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews