Index: trunk/Ohana/src/opihi/pcontrol/CheckSystem.c
===================================================================
--- trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 21379)
+++ trunk/Ohana/src/opihi/pcontrol/CheckSystem.c	(revision 25872)
@@ -357,5 +357,5 @@
       return (TRUE);
     }
-    dtime = DTIME (host[0].nexttry, start);
+    dtime = DTIME (host[0].next_start_try, start);
     if (dtime > 0) {
       PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM);
@@ -383,7 +383,25 @@
   float dtime;
 
-  /* check if there are any pending jobs, otherwise skip step */
+  /* check if there are any pending jobs */
   stack = GetJobStack (PCONTROL_JOB_PENDING);
-  if (!stack[0].Nobject) return (0);
+
+  /* if there are no pending jobs and we are not in STAGE_NEEDHOST, skip test */
+  if (!stack[0].Nobject && (Stage != PCONTROL_JOB_STAGE_NEEDHOST)) return (0);
+
+  /* if there are no pending jobs, check for hosts that need to be reset */
+  if (!stack[0].Nobject) {
+    /* cycle through IDLE hosts */
+    stack = GetHostStack (PCONTROL_HOST_IDLE);
+    Nobject = stack[0].Nobject;
+    for (i = 0; i < Nobject; i++) {
+      host = PullStackByLocation (stack, STACK_TOP);
+      if (host == NULL) break;
+      if (CheckResetHost (host)) {
+	return (1);
+      }
+      PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM);
+    }
+    return (0);
+  }
 
   /* Loop through objects on the stack, no more than once. see note above */
