问题就是这个"/etc/rc.d/init.d/qmail start &" 进程会结束吗。

解决方案 »

  1.   

    当然不会,qmail启动之后是要持续运行的。
    我面临的问题就是启动了持续运行的进程之后如何返回,自作聪明加了个“&”也没用
      

  2.   

    可能就是这个问题,QMAIL进程不会结束,Process也不会结束。The Runtime.exec methods create a native process and return an instance of a subclass of Process that can be used to control the process and obtain information about it. The class Process provides methods for performing input from the process, performing output to the process, waiting for the process to complete, checking the exit status of the process, and destroying (killing) the process. 
      

  3.   

    这样可以吗。
    try
            {            
                Runtime rt = Runtime.getRuntime();
                rt.exec("/etc/rc.d/init.d/qmail start &");
                out.println("进程正在启动:");
                
            } catch (Throwable t)
              {
                t.printStackTrace();
              }
      

  4.   

    看这一段说明,runtime.exec好像真的不行。
    请问老兄知道什么方法满足我的需求吗?