<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: running script in background thru Runtime.exec() hangs in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398873#M71014</link>
    <description>In your testb script, the execution stops after a point of time.  But for me, I am running a server and it will continue to run till I execute the stopscript.  In this scenario, it hangs, because the execution doesn't stop.</description>
    <pubDate>Wed, 20 Oct 2004 04:17:14 GMT</pubDate>
    <dc:creator>Mohammed Saleem_1</dc:creator>
    <dc:date>2004-10-20T04:17:14Z</dc:date>
    <item>
      <title>running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398866#M71007</link>
      <description>Hi all,&lt;BR /&gt;I tried to ran a script in Linux (which has a background process) through the Java code using Runtime.exec(), it gets hanged. The same script is working fine when i ran it directly. &lt;BR /&gt;&lt;BR /&gt;Is it a linux issue ? or any workaround is there ?&lt;BR /&gt;Any help would be highly appreciated.&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;shiva.t &lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 03:03:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398866#M71007</guid>
      <dc:creator>shiva_try</dc:creator>
      <dc:date>2004-10-13T03:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398867#M71008</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I tried to write a short Java class on my Linux:&lt;BR /&gt;&lt;BR /&gt;class Test&lt;BR /&gt;{&lt;BR /&gt;public static void main (String [] arg)&lt;BR /&gt;{&lt;BR /&gt;    if (arg.length &amp;lt; 1)&lt;BR /&gt;       System.exit (0);&lt;BR /&gt;    try&lt;BR /&gt;    {&lt;BR /&gt; Process p = Runtime.getRuntime().exec (arg[0]);&lt;BR /&gt; p.waitFor ();&lt;BR /&gt;    } catch (Exception e)&lt;BR /&gt;    {&lt;BR /&gt; e.printStackTrace ();&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I run a script which puts another script in background. It works, except that I get no output on my terminal.&lt;BR /&gt;&lt;BR /&gt;Linux is RedHat 8 and Java is Suns 1.4.1_01.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Wed, 13 Oct 2004 06:55:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398867#M71008</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-13T06:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398868#M71009</link>
      <description>hi bojan,&lt;BR /&gt;&lt;BR /&gt;thanks for your immediate response.&lt;BR /&gt;&lt;BR /&gt;For your code pass the process to the stream, now you will get the output.&lt;BR /&gt;----&lt;BR /&gt;BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));&lt;BR /&gt;while ((str = in.readLine()) != null) {&lt;BR /&gt; System.out.println("&amp;gt;&amp;gt;"+str);&lt;BR /&gt;}&lt;BR /&gt;}catch (FileNotFoundException fnfe) {&lt;BR /&gt;}catch (IOException fnfe) {}&lt;BR /&gt;-------&lt;BR /&gt;&lt;BR /&gt;In my case, i am calling the script "startservs" which internally executes a java&lt;BR /&gt;code in background, which is used to start the server.&lt;BR /&gt;--&lt;BR /&gt;Process p=Runtime.getRuntime().exec(startservs);&lt;BR /&gt;--&lt;BR /&gt;&lt;BR /&gt;Here it couldn't complete its process. So, it gets hanged. My aim is to complete the&lt;BR /&gt;process with the output.&lt;BR /&gt;&lt;BR /&gt;thanks&lt;BR /&gt;shiva.t&lt;BR /&gt;</description>
      <pubDate>Wed, 13 Oct 2004 08:05:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398868#M71009</guid>
      <dc:creator>shiva_try</dc:creator>
      <dc:date>2004-10-13T08:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398869#M71010</link>
      <description>shiva,&lt;BR /&gt;&lt;BR /&gt;I misunderstood the java.lang.Process documentation (read to fast ;). With yours code pass the program runs ok and with output. I tested also with running another java code and it also work ok.&lt;BR /&gt;&lt;BR /&gt;Maybe yours script or java code needs some input? If you look at the documentation &lt;A href="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Process.html" target="_blank"&gt;http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Process.html&lt;/A&gt;&lt;BR /&gt; there is a pass:&lt;BR /&gt;"Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock."&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Wed, 13 Oct 2004 11:24:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398869#M71010</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-13T11:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398870#M71011</link>
      <description>hi shiva,&lt;BR /&gt;&lt;BR /&gt;i have the same problem.  &lt;BR /&gt;&lt;BR /&gt;have you found a solution for this?  please share.&lt;BR /&gt;&lt;BR /&gt;saleem</description>
      <pubDate>Wed, 20 Oct 2004 00:27:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398870#M71011</guid>
      <dc:creator>Mohammed Saleem_1</dc:creator>
      <dc:date>2004-10-20T00:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398871#M71012</link>
      <description>Bojan,&lt;BR /&gt;&lt;BR /&gt;Can you share the script which had the background process?&lt;BR /&gt;&lt;BR /&gt;I think the issue comes when the background process is a continuous one.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Saleem&lt;BR /&gt;</description>
      <pubDate>Wed, 20 Oct 2004 00:44:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398871#M71012</guid>
      <dc:creator>Mohammed Saleem_1</dc:creator>
      <dc:date>2004-10-20T00:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398872#M71013</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I did this only for test. Substitute my test directory /home/bojan/tmp with yours. The first is a one line script (testa):&lt;BR /&gt;&lt;BR /&gt;/home/bojan/tmp/testb &amp;amp;&lt;BR /&gt;&lt;BR /&gt;The second script (testb):&lt;BR /&gt;&lt;BR /&gt;echo `date` &amp;gt;&amp;gt; /home/bojan/tmp/test.log&lt;BR /&gt;ls /home/bojan/tmp/&lt;BR /&gt;pwd&lt;BR /&gt;java SubTest 1 2 3 4&lt;BR /&gt;echo `date` &amp;gt;&amp;gt; /home/bojan/tmp/test.log&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now the two Java classes, the first (rewised with Shivas suggestions):&lt;BR /&gt;&lt;BR /&gt;class Test&lt;BR /&gt;{&lt;BR /&gt;public static void main (String [] arg)&lt;BR /&gt;{&lt;BR /&gt;    if (arg.length &amp;lt; 1) System.exit (0);&lt;BR /&gt;    try&lt;BR /&gt;    {&lt;BR /&gt;        Process p = Runtime.getRuntime().exec (arg[0]);&lt;BR /&gt;        BufferedReader in = new BufferedReader (new InputStreamReader(p.getInputStream()));&lt;BR /&gt;        String str;&lt;BR /&gt;        while ((str = in.readLine()) != null) {&lt;BR /&gt;                System.out.println("&amp;gt;&amp;gt;"+str);&lt;BR /&gt;        }&lt;BR /&gt;        p.waitFor ();&lt;BR /&gt; System.out.println ("Exit");&lt;BR /&gt;    } catch (Exception e)&lt;BR /&gt;    {&lt;BR /&gt;        e.printStackTrace ();&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;And a dummy SubTest:&lt;BR /&gt;&lt;BR /&gt;class SubTest&lt;BR /&gt;{&lt;BR /&gt;SubTest (String [] args)&lt;BR /&gt;{&lt;BR /&gt;   try&lt;BR /&gt;   {&lt;BR /&gt;   for (int i = 0; i &amp;lt; args.length; i++) {&lt;BR /&gt; System.out.println ("arg " + i + " = " + args[i]);&lt;BR /&gt; Thread.currentThread().sleep(Long.parseLong (args[i]) * 1000);&lt;BR /&gt;   }&lt;BR /&gt;   } catch (Exception e)&lt;BR /&gt;   {&lt;BR /&gt; e.printStackTrace ();&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;public static void main (String [] args)&lt;BR /&gt;{&lt;BR /&gt; new SubTest (args);&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;You run all with:&lt;BR /&gt;java Test /home/bojan/tmp/testa&lt;BR /&gt;&lt;BR /&gt;Attached is this text, to save java indents.&lt;BR /&gt;Bojan</description>
      <pubDate>Wed, 20 Oct 2004 02:37:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398872#M71013</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-20T02:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398873#M71014</link>
      <description>In your testb script, the execution stops after a point of time.  But for me, I am running a server and it will continue to run till I execute the stopscript.  In this scenario, it hangs, because the execution doesn't stop.</description>
      <pubDate>Wed, 20 Oct 2004 04:17:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398873#M71014</guid>
      <dc:creator>Mohammed Saleem_1</dc:creator>
      <dc:date>2004-10-20T04:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398874#M71015</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If I understand well, this is the same as if you modify my Test class in:&lt;BR /&gt;&lt;BR /&gt;class Test&lt;BR /&gt;{&lt;BR /&gt;public static void main (String [] arg)&lt;BR /&gt;{&lt;BR /&gt;if (arg.length &amp;lt; 1) System.exit (0);&lt;BR /&gt;try&lt;BR /&gt;{&lt;BR /&gt;Process p = Runtime.getRuntime().exec (arg[0]);&lt;BR /&gt;} catch (Exception e)&lt;BR /&gt;{&lt;BR /&gt;e.printStackTrace ();&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;?&lt;BR /&gt;&lt;BR /&gt;I try, it exit immediately after creating the process, the background script lives and do its job. The same is if I ommit testa and run directly testb or SubTest.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Wed, 20 Oct 2004 06:06:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398874#M71015</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-20T06:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398875#M71016</link>
      <description>hi bojan,&lt;BR /&gt;&lt;BR /&gt;Thanks for your frequent responses.&lt;BR /&gt;&lt;BR /&gt;In your code, the loop will execute based on your arguments length. Anyway the process would complete with delay.&lt;BR /&gt;&lt;BR /&gt;Whereas in our case the server will going to run continuously. So, i assume that checking with infinite loop in background will be useful&lt;BR /&gt;&lt;BR /&gt;Any ideas will be hightly appreciated.&lt;BR /&gt;Thanks&lt;BR /&gt;Shiva</description>
      <pubDate>Wed, 20 Oct 2004 09:48:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398875#M71016</guid>
      <dc:creator>shiva_try</dc:creator>
      <dc:date>2004-10-20T09:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398876#M71017</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Ok, I try with a modified SubTest which is in an infinite loop:&lt;BR /&gt;&lt;BR /&gt;class SubTest&lt;BR /&gt;{&lt;BR /&gt;SubTest (String [] args)&lt;BR /&gt;{&lt;BR /&gt;   try&lt;BR /&gt;   {&lt;BR /&gt;   for (;;) {&lt;BR /&gt; System.out.println ("arg = " + args[0]);&lt;BR /&gt; Thread.currentThread().sleep(Long.parseLong (args[0]) * 1000);&lt;BR /&gt;   }&lt;BR /&gt;   } catch (Exception e)&lt;BR /&gt;   {&lt;BR /&gt; e.printStackTrace ();&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;public static void main (String [] args)&lt;BR /&gt;{&lt;BR /&gt; new SubTest (args);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The results are identical to the previous test. The process remains active until my kill command. I did all 3 tests (testa,testb and SubTest without any shell script)&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Wed, 20 Oct 2004 11:06:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398876#M71017</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-20T11:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398877#M71018</link>
      <description>I did some new tests. Different environment:&lt;BR /&gt;Linux - RedHat 9&lt;BR /&gt;Java -&lt;BR /&gt;java version "1.3.1"&lt;BR /&gt;jdkgcj 0.2.3 (&lt;A href="http://www.arklinux.org/projects/jdkgcj)" target="_blank"&gt;http://www.arklinux.org/projects/jdkgcj)&lt;/A&gt;&lt;BR /&gt;gcj (GCC) 3.2.2 20030222 (Red Hat Linux 3.2.2-5)&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;java version "1.4.2_04"&lt;BR /&gt;Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)&lt;BR /&gt;Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I add two lines to the testb script before running the java SubTest:&lt;BR /&gt;&lt;BR /&gt;read x&lt;BR /&gt;echo $x &amp;gt;&amp;gt; /home/bojan/tmp/test.log&lt;BR /&gt;&lt;BR /&gt;In Test.java I read one line from the process   output stream and write one line to the input stream with:&lt;BR /&gt;&lt;BR /&gt;OutputStreamWriter os = new OutputStreamWriter (p.getOutputStream ());&lt;BR /&gt;os.write ("test\n" , 0 , 5);&lt;BR /&gt;os.flush ();&lt;BR /&gt;&lt;BR /&gt;and exit from program.&lt;BR /&gt;This works ok. Then I delete the line which does flush. With gcj all ok, but with Sun java the process die.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Wed, 20 Oct 2004 14:14:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398877#M71018</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-20T14:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398878#M71019</link>
      <description>hi Bojan,&lt;BR /&gt;&lt;BR /&gt;It seems that if I do not access the streams, the process continues to work.  The problem with regard to the hanging is solved.  But the pitfall here is that I cannot get the output of the program.&lt;BR /&gt;&lt;BR /&gt;The hanging issue comes into picture when I try to access the InputStream of the process.  For now, I have created a workaround.  I call my main script from another script, which has mainscript &amp;gt;&amp;gt; mainscript.log, and then from the java file I empty the contents of mainscript.log to the console.  So job done!  Your point about the OutputStream was really helpful.  Thanks a bunch!&lt;BR /&gt;&lt;BR /&gt;Now, I want to see the reason why the programs hangs when we try to access the InputStream?  Any ideas?&lt;BR /&gt;</description>
      <pubDate>Thu, 21 Oct 2004 01:42:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398878#M71019</guid>
      <dc:creator>Mohammed Saleem_1</dc:creator>
      <dc:date>2004-10-21T01:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398879#M71020</link>
      <description>Mohammed,&lt;BR /&gt;&lt;BR /&gt;Try to ask Google "java process stream hang" &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.google.com/search?hl=en&amp;amp;lr=&amp;amp;safe=off&amp;amp;q=java+process+stream+hang" target="_blank"&gt;http://www.google.com/search?hl=en&amp;amp;lr=&amp;amp;safe=off&amp;amp;q=java+process+stream+hang&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There are many descriptions of this simptom. Maybe some of them will explain yours questions.&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Thu, 21 Oct 2004 01:56:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398879#M71020</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-21T01:56:57Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398880#M71021</link>
      <description>Shiva, Mohammed,&lt;BR /&gt;&lt;BR /&gt;My considerations abbout standard I/O streams (not tested!).&lt;BR /&gt;I think that, if you have a background process, which will live alone after the main process will exit, you must reassign all three streams to something known (probably files) with System.setErr(), System.setIn() and System.setOut(). If you do not do that, the streams are cuted out when the main process exits and writing or reading will produce some strange effects (hangs, exceptions etc). For the communication between the main process and the background process you must use some other method (maybe sockets) or implement some sort of "protocol" which will tell to both sides, when the communication is finished. When the communication is finished the background process will reassign the streams and the main process will not try to write or read to the streams. Probably you can close them (but this must be tested).&lt;BR /&gt;&lt;BR /&gt;Another time: This are my considerations which was not tested. When you get in such troubles, it is a good practice to write some small programs to test the behavior (and with Java that should be done on different OSes).&lt;BR /&gt;&lt;BR /&gt;Bojan</description>
      <pubDate>Thu, 21 Oct 2004 03:18:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398880#M71021</guid>
      <dc:creator>Bojan Nemec</dc:creator>
      <dc:date>2004-10-21T03:18:26Z</dc:date>
    </item>
    <item>
      <title>Re: running script in background thru Runtime.exec() hangs</title>
      <link>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398881#M71022</link>
      <description>Hi Chaps&lt;BR /&gt;&lt;BR /&gt;I have followed your thread with interest as I am having difficulties in similar areas.&lt;BR /&gt;&lt;BR /&gt;Context:&lt;BR /&gt; - I am writing an application that mimicks a high availability solution so that I can run a configurable number of processes on a configurable number of linux servers.  On each box resides a java process (Daemon) that starts the processes for me based on input from a remote server (uses RMI).&lt;BR /&gt;&lt;BR /&gt;Problem:&lt;BR /&gt; - unable to stop an external process&lt;BR /&gt;&lt;BR /&gt;Symptoms:&lt;BR /&gt; - if I run a c++ executable directly (for example a simple compiled exe that just does some looping) and I call destroy on the process, the exe dies as I would expect&lt;BR /&gt; - if I create a very simple shell script and run it and then try and kil it all is well .. eg&lt;BR /&gt;#!/bin/csh -f&lt;BR /&gt;while (1)&lt;BR /&gt;   echo "hello"&lt;BR /&gt;end&lt;BR /&gt; - if I then try to run a java process in a ksh script and try and kill it, the destroy method does not actually kill the process at all .. a really nasty one if you are trying to abstract the OS/host from the user.  Have you come accross this?  Have you tried to run other java processes with the java.lang.Process class?</description>
      <pubDate>Fri, 29 Oct 2004 05:54:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/running-script-in-background-thru-runtime-exec-hangs/m-p/3398881#M71022</guid>
      <dc:creator>Peter Suggitt</dc:creator>
      <dc:date>2004-10-29T05:54:22Z</dc:date>
    </item>
  </channel>
</rss>

