title: JAVA Quartz's puzzle
body: <p>My Project is to build up a schedule system to schedule some crawler at a specific time by cron expression, and i choose to use quartz. I create a sub process in a Job object. When the job is scheduled, it'll created a process to launch a scrapy crawler to fetch the data, and the father process is wait using <code>waitFor() java api.</code> Sth like this:</p>
  
  <pre><code> public void execute(JobExecutionContext context) throws JobExecutionException {
          try {
                  JobKey jobKey = context.getJobDetail().getKey();
                  System.out.println("CrawlerJob says: " + jobKey + " executing at " + new Date());
                  JobDataMap dataMap = context.getJobDetail().getJobDataMap();
                  String scrapycmd=dataMap.getString("ScrapyCMD");
                  Process process=Runtime.getRuntime().exec(scrapycmd);
  
                  System.out.println("wait for process...");
                  process.waitFor();
          }catch(InterruptedException e){
              e.printStackTrace();
          }catch (IOException e) {
              e.printStackTrace();
              _log.info(e.toString());
          }
  }
  </code></pre>
  
  <p>the ScrapyCMD is <code>scrapy crawl myspider</code>. however, when it scheduled, i found the process was only work in a very shortime, and then i was using <code>ps -aux | grep python</code>:</p>
  
  <pre><code>gabriel   4202  0.0  1.0 755672 39400 pts/2    Sl+  22:14   0:02 /usr/local/bin/python /usr/local/bin/scrapy crawl myspider
  </code></pre>
  
  <p>the status of the subprocess is sl+, and the whole process was halt there. How to fix it and  let the subprocess executed in this Job object?</p>