🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

SV: Problem terminate started process with the Runtime class

#2029
From: Kristian
Date: Wed, 27 Jun 2001 19:01
41 lines
2565 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.

- Well if you could tell me of how to do that, this would be the easiest
solution for me. I have tried to give some options (flags) when starting
tcsh, But I didn't succeed...

Another thing that hit my mind is, if I configure tcsh, how would that
affect other processes that are launched from tcsh...or would the
configuration only consist my evironment that belongs to my Java
application?


>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.

- I know, but then I get some synchronization problems because I continously
read both from standard output and standard error. I know I can redirect
standard out and err to a logfile and will probably look for that solution
if the configuration of tcsh is  to prefer instead of the redirection

Regards
/Kristian
Technical Details
Message-ID: <3b3a2d60$1_1@dnews>
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> <MPG.15a1e4a7ab72707c98a2dc@forums.borland.com>

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-27 12:10:30 PST
From: "Kristian" <kristian@nr1.nu>
Newsgroups: borland.public.jbuilder.java.api
References: <3b377c03_1@dnews> <MPG.15a1e4a7ab72707c98a2dc@forums.borland.com>
Subject: SV: Problem terminate started process with the Runtime class 
Date: Wed, 27 Jun 2001 21:01:59 +0200
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2314.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
NNTP-Posting-Host: 213.88.177.80
Message-ID: <3b3a2d60$1_1@dnews>
X-Trace: dnews 993668448 213.88.177.80 (27 Jun 2001 12:00:48 -0700)
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