title: Java processbuilder child processes continue after exit
body: <p>I'm working on an auto-update script that should be able to restart the daemon once it completes. </p>
  
  <p>I'm currently trying this:</p>
  
  <pre><code>    final ArrayList&lt;String&gt; command = new ArrayList&lt;String&gt;();
      String initScriptPath = Config.GetStringWithDefault("init_script", "/etc/init.d/my-daemon");
      command.add("/bin/bash");
      command.add("-c");
      command.add("'" + initScriptPath + " restart'");
  
      StringBuilder sb = new StringBuilder();
      for (String c : command) {
          sb.append(c).append(" ");
      }
      Log.write(LogPriority.DEBUG, "Attempting restart with: " + sb.toString());
  
      final ProcessBuilder builder = new ProcessBuilder(command);
  
      builder.start();
  
      // Wait for a couple of seconds
      try {
          Thread.sleep(5000);
      } catch (Exception e) {
      }
  
      System.exit(0);
  </code></pre>
  
  <p>However the System.exit seems to stop the restart? It does actually stop, but does not start again.</p>