Index: trunk/ippTasks/dist.pro
===================================================================
--- trunk/ippTasks/dist.pro	(revision 23967)
+++ trunk/ippTasks/dist.pro	(revision 24001)
@@ -14,4 +14,5 @@
 $distToProcess_DB = 0
 $distToAdvance_DB = 0
+$distQueue_DB = 0
 
 ### Check status of tasks
@@ -293,2 +294,61 @@
 end
 
+task	       dist.queueruns
+#  host         local
+
+  periods      -poll $RUNPOLL
+  periods      -exec 10
+  periods      -timeout 45
+  npending     1
+
+#  stdout $LOGDIR/dist.queuruns
+#  stderr $LOGDIR/dist.queueruns
+
+  task.exec
+    $MYARGS = ""
+    # assume that we need magic unless we are running simtest
+    if ($?SIMTEST_CAMERA != 0)
+        $MYARGS = --no_magic
+    end
+
+    $run = dist_queue_runs.pl $MYARGS --stage_limit 16 --logfile $LOGDIR/dist.queueruns
+
+    if ($DB:n == 0)
+       $DBNAME = DEFAULT
+    else
+      # save the DB name for add_standard_args
+      $DBNAME =  $DB:$distQueue_DB
+      $distQueue_DB ++
+      if ($distQueue_DB >= $DB:n) set distQueue_DB = 0
+    end
+
+    host anyhost
+
+    add_standard_args run
+
+    # create the command line
+    if ($VERBOSE > 1)
+      echo command $run
+    end
+    command $run
+  end
+
+  task.exit     $EXIT_SUCCESS
+    # nothing to do
+  end
+
+  # default exit status
+  task.exit    default
+    showcommand failure
+  end
+
+  # operation timed out?
+  task.exit    timeout
+    showcommand timeout
+  end
+
+  # operation timed out?
+  task.exit    crash
+    showcommand crash
+  end
+end
