Browse Source

Fix to tripal_jobs_check_running(): now uses ps rather then postix_kill since postix_kill might unintentionally kill jobs on some OSes

Lacey Sanderson 13 years ago
parent
commit
522d8c13ef
1 changed files with 2 additions and 1 deletions
  1. 2 1
      tripal_core/jobs.php

+ 2 - 1
tripal_core/jobs.php

@@ -310,7 +310,8 @@ function tripal_jobs_check_running () {
            "WHERE TJ.end_time IS NULL and NOT TJ.start_time IS NULL ";
            "WHERE TJ.end_time IS NULL and NOT TJ.start_time IS NULL ";
    $jobs = db_query($sql);
    $jobs = db_query($sql);
    while($job = db_fetch_object($jobs)){
    while($job = db_fetch_object($jobs)){
-      if($job->pid and posix_kill($job->pid, 0)) {
+      $status = `ps --pid=$job->pid --no-header`;
+      if($job->pid && $status) {
          // the job is still running so let it go
          // the job is still running so let it go
 		   // we return 1 to indicate that a job is running
 		   // we return 1 to indicate that a job is running
 		   print "Job is still running (pid $job->pid)\n";
 		   print "Job is still running (pid $job->pid)\n";