Index: trunk/Ohana/src/opihi/pantasks/CheckJobs.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/CheckJobs.c	(revision 4705)
@@ -26,9 +26,10 @@
       case JOB_CRASH:
 	/* run task[0].crash macro, if it exists */
-	/* set the stdout and stderr variables with job.stdout, job.stderr */
-	/* XXX this will break on 0 values in output streams */
+	/* push output buffer data to the stdout and stderr queues */
 	if (VerboseMode()) fprintf (stderr, "job %s (%d) crash\n", job[0].task[0].name, job[0].JobID);
 	PushNamedQueue ("stdout", job[0].stdout.buffer);
 	PushNamedQueue ("stderr", job[0].stderr.buffer);
+	/* XXX this will break on 0 values in output streams */
+	/* perhaps define PushNamedQueueBuffer */
 	if (job[0].task[0].crash != NULL) {
 	  exec_loop (job[0].task[0].crash);
@@ -43,5 +44,5 @@
 	PushNamedQueue ("stderr", job[0].stderr.buffer);
 	/* run corresponding task[0].exit macro, if it exists */
-	macro = job[0].task[0].def;
+	macro = job[0].task[0].defexit;
 	for (i = 0; i < job[0].task[0].Nexit; i++) {
 	  if (job[0].exit_status == atoi(job[0].task[0].exit[i][0].name)) {
Index: trunk/Ohana/src/opihi/pantasks/ControllerOps.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/ControllerOps.c	(revision 4705)
@@ -1,15 +1,17 @@
 # include "psched.h"
-# define CONTROLLER_TIMEOUT 20
+/* adding a new host can delay controller up to a second or so */
+# define CONTROLLER_TIMEOUT 200
 # define CONNECT_TIMEOUT 300
 
 /* local static variables to hold the connection to the controller */
-static int status = FALSE;
+static int ControllerStatus = FALSE;
 static int stdin_cntl, stdout_cntl, stderr_cntl;
 static IOBuffer stdout_buffer;
 static IOBuffer stderr_buffer;
+static int ControllerPID = 0;
 
 /* test if the controller is running */
 int CheckControllerStatus () {
-  return (status);
+  return (ControllerStatus);
 }
 
@@ -29,5 +31,5 @@
 int CheckControllerJobStatus (Job *job) {
 
-  int outstate;
+  int outstate, status;
   char cmd[128], status_string[64];
   char *p;
@@ -41,19 +43,19 @@
   switch (status) {
     case CONTROLLER_DOWN:
-      fprintf (stderr, "controller is down\n");
+      if (VerboseMode()) fprintf (stderr, "controller is down\n");
       FreeIOBuffer (&buffer);
       return (FALSE);
 
     case CONTROLLER_HUNG:
-      fprintf (stderr, "controller is not responding\n");
+      if (VerboseMode()) fprintf (stderr, "controller is not responding\n");
       FreeIOBuffer (&buffer);
       return (FALSE);
 
     case CONTROLLER_GOOD:
-      fprintf (stderr, "message received (CheckControllerJobStatus)\n");
+      if (VerboseMode()) fprintf (stderr, "message received (CheckControllerJobStatus)\n");
       break;
 
     default:
-      fprintf (stderr, "unknown status for controller command: programming error\n");  
+      if (VerboseMode()) fprintf (stderr, "unknown status for controller command: programming error\n");  
       exit (1);
   }
@@ -105,8 +107,5 @@
 
   /* send command to get appropriate channel */
-  ALLOCATE (line, char, MAX (1, strlen(cmd) + 15));
-  sprintf (line, "%s %d\n", cmd, pid);
-  status = write (stdin_cntl, line, strlen(line));
-  free (line);
+  status = write_fmt (stdin_cntl, "%s %d\n", cmd, pid);
 
   /* is pipe still open? */
@@ -126,5 +125,5 @@
   if (status == -1) return (CONTROLLER_HUNG);
 
-  fprintf (stderr, "message received (GetJobOutput : %s)\n", cmd);  
+  if (VerboseMode()) fprintf (stderr, "message received (GetJobOutput : %s)\n", cmd);  
   /* drop extra bytes from pcontrol (not pclient:job) */
   buffer[0].Nbuffer = Nstart + Nbytes;
@@ -161,5 +160,5 @@
 
   /* construct the controller command portion */
-  if (!strcmp (job[0].task[0].host, "NONE")) {
+  if (!strcasecmp (job[0].task[0].host, "ANYHOST")) {
     sprintf (cmd, "job");
   } else {
@@ -177,10 +176,7 @@
   }
 
-  fprintf (stderr, "sending command to controller: %s\n", cmd);
   InitIOBuffer (&buffer, 0x100);
   ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
   free (cmd);
-
-  fprintf (stderr, "response from controller: %s\n", buffer.buffer);
 
   /* extract the job PID from the controller response */
@@ -203,9 +199,9 @@
   char *p;
   char **argv, cmd[128];
-  int i, pid;
+  int i, pid, status;
   int stdin_fd[2], stdout_fd[2], stderr_fd[2];
   IOBuffer buffer;
 
-  if (status) return (TRUE);
+  if (ControllerStatus) return (TRUE);
 
   if (VarConfig ("CONTROLLER", "%s", cmd) == NULL) strcpy (cmd, "pcontrol");
@@ -262,6 +258,5 @@
 
   /* send handshake command */
-  sprintf (cmd, "echo CONNECTED\n");
-  status = write (stdin_fd[1], cmd, strlen(cmd));
+  status = write_fmt (stdin_fd[1], "echo CONNECTED\n");
   if ((status == -1) && (errno == EPIPE)) goto pipe_error;
 
@@ -286,4 +281,6 @@
   InitIOBuffer (&stderr_buffer, 0x100);
 
+  ControllerPID = pid;
+  ControllerStatus = TRUE;
   fprintf (stderr, "Connected\n");
   return (TRUE);
@@ -316,13 +313,8 @@
   FlushIOBuffer (buffer);
 
-  fprintf (stderr, "send: %s\n", cmd);
-
-  /* send command to client (adding on \n) */
-  ALLOCATE (line, char, MAX (1, strlen(cmd)));
-  sprintf (line, "%s\n", cmd);
-  status = write (stdin_cntl, line, strlen(line));
-  free (line);
-
-  /* is pipe still open? */
+  if (VerboseMode()) fprintf (stderr, "send: %s\n", cmd);
+
+  /* send command, is pipe still open? */
+  status = write_fmt (stdin_cntl, "%s\n", cmd);
   if ((status == -1) && (errno == EPIPE)) return (CONTROLLER_DOWN);
   
@@ -335,7 +327,16 @@
     if (status == -1) usleep (10000);
   }
-  if (status ==  0) return (CONTROLLER_DOWN);
+  if (status ==  0) {
+    ControllerStatus = FALSE;
+    return (CONTROLLER_DOWN);
+  }
   if (status == -1) return (CONTROLLER_HUNG);
-  /* fprintf (stderr, "buffer.buffer: %s\n", buffer[0].buffer); */
+
+  /* need to strip off the prompt */
+  line = memstr (buffer[0].buffer, response, buffer[0].Nbuffer);
+  if (line != NULL) {
+    buffer[0].Nbuffer = line - buffer[0].buffer;
+    bzero (buffer[0].buffer + buffer[0].Nbuffer, buffer[0].Nalloc - buffer[0].Nbuffer);
+  }
   return (CONTROLLER_GOOD);
 }
@@ -345,5 +346,5 @@
   int Nread;
 
-  if (!status) return (TRUE);
+  if (!ControllerStatus) return (TRUE);
 
   /* read stdout buffer */
@@ -390,5 +391,5 @@
   IOBuffer buffer;
 
-  if (!CheckControllerStatus()) return (TRUE);
+  if (!ControllerStatus) return (TRUE);
 
   sprintf (cmd, "kill %d", job[0].pid);
@@ -403,15 +404,24 @@
 int QuitController () {
 
-  int status;
+  int i, status, waitstatus, result;
   char cmd[128];
   IOBuffer buffer;
 
-  if (!CheckControllerStatus()) return (TRUE);
+  if (!ControllerStatus) return (TRUE);
 
   sprintf (cmd, "quit");
   InitIOBuffer (&buffer, 0x100);
   status = ControllerCommand (cmd, CONTROLLER_PROMPT, &buffer);
-  return (TRUE);
-}
-
-/* memstr returns a view, not an allocated string : don't free */
+  ControllerStatus = FALSE;
+  result = waitpid (ControllerPID, &waitstatus, WNOHANG);
+  for (i = 0; (i < 10) && (result == 0); i++) {
+    usleep (10000);  /* 10 ms is min */
+    result = waitpid (ControllerPID, &waitstatus, WNOHANG);
+  }
+  ControllerPID = 0;
+  close (stdin_cntl);
+  close (stdout_cntl);
+  close (stderr_cntl);
+
+  return (TRUE);
+}
Index: trunk/Ohana/src/opihi/pantasks/JobOps.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 4705)
@@ -50,11 +50,13 @@
   int i;
 
+  fprintf (stderr, "\n");
   if (Njobs == 0) {
-    fprintf (stderr, "no defined jobs\n");
+    fprintf (stderr, " no defined jobs\n");
     return;
   }
 
+  fprintf (stderr, " Jobs\n");
   for (i = 0; i < Njobs; i++) {
-    fprintf (stderr, "%d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv);
+    fprintf (stderr, " %d: %-15s %5d %20s (%lx)\n", Njobs, jobs[i][0].task[0].name, jobs[i][0].JobID, jobs[i][0].argv[0], (long) jobs[i][0].argv);
   }
   return;
@@ -76,7 +78,6 @@
   }
 
-  /* we need our own copy of task[0].argv 
-   *  argc is the number of valid args, like the usual command line.
-   *  we allocate one extra element, with value 0 to be passed to execvp
+  /* we need our own copy of task[0].argv argc is the number of valid args, like the usual command line.  we
+   *  allocate one extra element, with value 0 to be passed to execvp
    */
   job[0].argc = task[0].argc;
@@ -87,14 +88,11 @@
   job[0].argv[i] = 0;
 
-  /* other data from the task is needed by the job 
-     we carry a pointer back to the task.  this means we 
-     cannot modify the task once a job is created, or the changes will 
-     be applied to the existing jobs */
+  /* Other data from the task is needed by the job. We carry a pointer back to the task.  Changes to an
+     executing task are applied to the existing jobs (exit macros, poll_period, timeout) */
 
   job[0].task = task;
   
-  /* if we decide we need to be able to dynamically set task qualities
-     (like host, timeouts, etc), the we will need to have matched 
-     entries to these quantites in the job structure */
+  /* if we decide we need to be able to dynamically set task qualities (like host, timeouts, etc), the we will
+     need to have matched entries to these quantites in the job structure */
 
   jobs[Njobs] = job;
@@ -122,5 +120,5 @@
 }
 
-/** are we deleting the active job?? **/
+/* delete the job from the job list & adjust ActiveJob counter */
 int DeleteJob (Job *job) {
 
@@ -140,6 +138,7 @@
 
   FreeJob (jobs[Nm]);
-  for (i = Nm + 1; i < Njobs; i++)
-    jobs[i - 1] = jobs[i];
+  for (i = Nm; i < Njobs - 1; i++) {
+    jobs[i] = jobs[i + 1];
+  }
   Njobs --;
 
Index: trunk/Ohana/src/opihi/pantasks/Makefile
===================================================================
--- trunk/Ohana/src/opihi/pantasks/Makefile	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/Makefile	(revision 4705)
@@ -41,4 +41,5 @@
 $(SDIR)/run.$(ARCH).o \
 $(SDIR)/stop.$(ARCH).o \
+$(SDIR)/pulse.$(ARCH).o \
 $(SDIR)/status.$(ARCH).o \
 $(SDIR)/kill.$(ARCH).o \
Index: trunk/Ohana/src/opihi/pantasks/TaskOps.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/TaskOps.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/TaskOps.c	(revision 4705)
@@ -54,35 +54,41 @@
   int i, valid;
 
+  fprintf (stderr, "\n");
   if (Ntasks == 0) {
-    fprintf (stderr, "no defined tasks\n");
+    fprintf (stderr, " no defined tasks\n");
     return;
   }
 
-  fprintf (stderr, "Task Status\n");
-  fprintf (stderr, "  name            Njobs  command\n");
+  fprintf (stderr, " Task Status\n");
+  fprintf (stderr, "  * Name            Njobs  Command\n");
   for (i = 0; i < Ntasks; i++) {
     valid = CheckTimeRanges (tasks[i][0].ranges, tasks[i][0].Nranges);
+    if (verbose) fprintf (stderr, "\n");
     if (valid) {
-      fprintf (stderr, "+ ");
+      fprintf (stderr, "  + ");
     } else {
-      fprintf (stderr, "- ");
+      fprintf (stderr, "  - ");
     }
     if (tasks[i][0].argv == NULL) {
-      fprintf (stderr, "%-15s %4d   %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, "dynamic");
+      fprintf (stderr, "%-15s %5d  %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, "(dynamic)");
     } else {
-      fprintf (stderr, "%-15s %4d   %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].argv[0]);
+      fprintf (stderr, "%-15s %5d  %-20s\n", tasks[i][0].name, tasks[i][0].Njobs, tasks[i][0].argv[0]);
     }
     if (verbose) {
       fprintf (stderr, "    spawn period: %f, polling period: %f, timeout period: %f\n", 
-	       tasks[i][0].poll_period, tasks[i][0].poll_period, tasks[i][0].poll_period);
-      if (tasks[i][0].host != NULL) {
-	if (tasks[i][0].host_required) {
-	  fprintf (stderr, "    host %s (required)\n", tasks[i][0].host);
-	} else {
-	  fprintf (stderr, "    host %s (desired)\n", tasks[i][0].host);
-	}
+	       tasks[i][0].exec_period, tasks[i][0].poll_period, tasks[i][0].timeout_period);
+      if (tasks[i][0].host == NULL) {
+	fprintf (stderr, "    task runs locally\n");
+	continue;
+      }
+      if (!strcasecmp(tasks[i][0].host, "ANYHOST")) {
+	fprintf (stderr, "    task host selected by controller\n");
+	continue;
+      }
+      if (tasks[i][0].host_required) {
+	fprintf (stderr, "    host %s (required)\n", tasks[i][0].host);
       } else {
-	fprintf (stderr, "    task runs locally\n");
-      }      
+	fprintf (stderr, "    host %s (desired)\n", tasks[i][0].host);
+      }
     }
   }
@@ -102,29 +108,44 @@
   }
 
-  fprintf (stderr, "macro %s\n", task[0].name);
-
-  fprintf (stderr, "command: ");
+  fprintf (stderr, "\n macro %s\n", task[0].name);
+
+  fprintf (stderr, "\n command: ");
   for (i = 0; i < task[0].argc; i++) {
     fprintf (stderr, "%s ", task[0].argv[i]);
   }
-
-  fprintf (stderr, "host: %s\n", task[0].host);
-  fprintf (stderr, "time periods: exec: %f  poll: %f  timeout: %f\n", 
+  fprintf (stderr, "\n\n");
+
+  if (task[0].host == NULL) {
+    fprintf (stderr, " task runs locally\n");
+    goto periods;
+  }
+  if (!strcasecmp(task[0].host, "ANYHOST")) {
+    fprintf (stderr, " task host selected by controller\n");
+    goto periods;
+  }
+  if (task[0].host_required) {
+    fprintf (stderr, " host %s (required)\n", task[0].host);
+  } else {
+    fprintf (stderr, " host %s (desired)\n", task[0].host);
+  }
+
+periods:
+  fprintf (stderr, " time periods: exec: %f  poll: %f  timeout: %f\n", 
 	   task[0].exec_period, task[0].poll_period, task[0].timeout_period);
 
-  fprintf (stderr, "pre-execute macro\n");
+  fprintf (stderr, "\n pre-execute macro\n");
   ListMacro (task[0].exec);
 
-  fprintf (stderr, "timeout macro\n");
+  fprintf (stderr, "\n timeout macro\n");
   ListMacro (task[0].timeout);
 
-  fprintf (stderr, "crash macro\n");
+  fprintf (stderr, "\n crash macro\n");
   ListMacro (task[0].crash);
 
-  fprintf (stderr, "default exit macro\n");
-  ListMacro (task[0].def);
+  fprintf (stderr, "\n default exit macro\n");
+  ListMacro (task[0].defexit);
 
   for (i = 0; i < task[0].Nexit; i++) {
-    fprintf (stderr, "exit macro (status == %d)\n", atoi(task[0].exit[i][0].name));
+    fprintf (stderr, "\n exit macro (status == %d)\n", atoi(task[0].exit[i][0].name));
     ListMacro (task[0].exit[i]);
   }
@@ -192,4 +213,5 @@
   NewTask[0].crash = NULL;
   NewTask[0].timeout = NULL;
+  NewTask[0].defexit = NULL;
 
   NewTask[0].Nexit = 0;
@@ -211,4 +233,28 @@
 
   return (NewTask);
+}
+
+/* remove the task from the task list */
+int RemoveTask (Task *task) {
+  
+  int i, Nt;
+
+  /* find task in task list */
+  Nt = -1;
+  for (i = 0; i < Ntasks; i++) {
+    if (task == tasks[i]) {
+      Nt = i;
+      break;
+    }
+  }
+  if (Nt == -1) {
+    fprintf (stderr, "programming error: task not found\n");
+    return (FALSE);
+  }
+  for (i = Nt; i < Ntasks - 1; i++) {
+    tasks[i] = tasks[i+1];
+  }
+  Ntasks --;
+  return (TRUE);
 }
 
@@ -263,4 +309,9 @@
   }
   return (TRUE);
+}
+
+Task *SetNewTask (Task *task) {
+  NewTask = task;
+  return (task);
 }
 
Index: trunk/Ohana/src/opihi/pantasks/controller_check.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/controller_check.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/controller_check.c	(revision 4705)
@@ -21,4 +21,9 @@
   InitIOBuffer (&buffer, 0x100);
   status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  if (VerboseMode()) {
+    fprintf (stderr, "controller command sent\n");  
+    fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);
+    fprintf (stderr, "\n Nbytes received: %d\n", buffer.Nbuffer);  
+  }
   FreeIOBuffer (&buffer);
 
@@ -34,6 +39,4 @@
 
     case CONTROLLER_GOOD:
-      fprintf (stderr, "controller command sent\n");  
-      fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);
       return (TRUE);
 
Index: trunk/Ohana/src/opihi/pantasks/controller_host.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/controller_host.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/controller_host.c	(revision 4705)
@@ -7,6 +7,6 @@
   IOBuffer buffer;
 
-  if (argc != 2) {
-    fprintf (stderr, "USAGE: controller host (hostname)\n");
+  if (argc != 3) {
+    fprintf (stderr, "USAGE: controller host (command) (hostname)\n");
     return (FALSE);
   }
@@ -15,7 +15,8 @@
   StartController ();
 
-  sprintf (command, "host %s", argv[1]);
+  sprintf (command, "host %s %s", argv[1], argv[2]);
   InitIOBuffer (&buffer, 0x100);
   status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
+  fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);
   FreeIOBuffer (&buffer);
 
@@ -31,7 +32,4 @@
 
     case CONTROLLER_GOOD:
-      fprintf (stderr, "controller command sent\n");  
-      fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);
-      fprintf (stderr, "\n Nbytes received: %d\n", buffer.Nbuffer);  
       return (TRUE);
 
Index: trunk/Ohana/src/opihi/pantasks/controller_status.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/controller_status.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/controller_status.c	(revision 4705)
@@ -22,5 +22,4 @@
   InitIOBuffer (&buffer, 0x100);
   status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);
-  FreeIOBuffer (&buffer);
 
   /* check on success of controller command */
@@ -28,14 +27,15 @@
     case CONTROLLER_DOWN:
       fprintf (stderr, "controller is down\n");
+      FreeIOBuffer (&buffer);
       return (FALSE);
 
     case CONTROLLER_HUNG:
       fprintf (stderr, "controller is not responding\n");
+      FreeIOBuffer (&buffer);
       return (FALSE);
 
     case CONTROLLER_GOOD:
-      fprintf (stderr, "controller command sent\n");  
       fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr);
-      fprintf (stderr, "\n Nbytes received: %d\n", buffer.Nbuffer);  
+      FreeIOBuffer (&buffer);
       return (TRUE);
 
Index: trunk/Ohana/src/opihi/pantasks/init.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/init.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/init.c	(revision 4705)
@@ -11,4 +11,5 @@
 int run             PROTO((int, char **));
 int stop            PROTO((int, char **));
+int pulse           PROTO((int, char **));
 int status_sys      PROTO((int, char **));
 int kill_job        PROTO((int, char **));
@@ -28,4 +29,5 @@
   {"run",        run,          "run the scheduler"},
   {"stop",       stop,         "stop the scheduler"},
+  {"pulse",      pulse,        "set the scheduler update period"},
   {"status",     status_sys,   "get system status"},
   {"kill",       kill_job,     "kill job"},
Index: trunk/Ohana/src/opihi/pantasks/psched.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/psched.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/psched.c	(revision 4705)
@@ -39,5 +39,5 @@
   rl_attempted_completion_function = command_completer;
   rl_event_hook = NULL;
-  rl_set_keyboard_input_timeout (1000000); 
+  rl_set_keyboard_input_timeout (100000); 
 
   set_str_variable ("HISTORY", opihi_history);
Index: trunk/Ohana/src/opihi/pantasks/pulse.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/pulse.c	(revision 4705)
+++ trunk/Ohana/src/opihi/pantasks/pulse.c	(revision 4705)
@@ -0,0 +1,16 @@
+# include "psched.h"
+
+int pulse (int argc, char **argv) {
+
+  int Nusec;
+
+  if (argc != 2) {
+    fprintf (stderr, "USAGE: pulse (microseconds)\n");
+    return (FALSE);
+  }
+
+  Nusec = atoi (argv[1]);
+  rl_set_keyboard_input_timeout (Nusec); 
+
+  return (TRUE);
+}
Index: trunk/Ohana/src/opihi/pantasks/run.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/run.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/run.c	(revision 4705)
@@ -10,5 +10,4 @@
   InitTaskTimers ();
   rl_event_hook = CheckSystem;
-  rl_set_keyboard_input_timeout (1000000); 
 
   return (TRUE);
Index: trunk/Ohana/src/opihi/pantasks/status.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/status.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/status.c	(revision 4705)
@@ -3,8 +3,14 @@
 int status_sys (int argc, char **argv) {
 
+  fprintf (stderr, "\n");
   if (rl_event_hook == NULL) {
-    fprintf (stderr, "scheduler is stopped\n");
+    fprintf (stderr, " Scheduler is stopped\n");
   } else {
-    fprintf (stderr, "scheduler is running\n");
+    fprintf (stderr, " Scheduler is running\n");
+  }
+  if (CheckControllerStatus ()) {
+    fprintf (stderr, " Controller is running\n");
+  } else {
+    fprintf (stderr, " Controller is stopped\n");
   }
   ListTasks (FALSE);
Index: trunk/Ohana/src/opihi/pantasks/stop.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/stop.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/stop.c	(revision 4705)
@@ -9,5 +9,4 @@
 
   rl_event_hook = NULL;
-  rl_set_keyboard_input_timeout (1000000); 
 
   return (TRUE);
Index: trunk/Ohana/src/opihi/pantasks/task.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/task.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/task.c	(revision 4705)
@@ -36,11 +36,15 @@
   if (task == NULL) { /**** new task ****/
     task = CreateTask (argv[1]);
+  } else {
+    RemoveTask (task);
+    SetNewTask (task);
   }
-  /* temporary task is saved statically 
-     add to list after definition is complete */
+  /* While a task is being defined, it is removed from the task list.  The new task is added to the task list
+     when the definition process is complete.  
+     XXX If an outstanding job has a task deleted, it will not be able to complete... */
 
   /* read in task from appropriate source (keyboard or list) until end */
 
-  /* allowed tokens: command, host, stderr, periods, end */
+  /* allowed tokens: command, host, stderr, periods, trange, nmax, task.exit, task.exec, end */
 
   ThisList = Nlists;
Index: trunk/Ohana/src/opihi/pantasks/task_command.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/task_command.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/task_command.c	(revision 4705)
@@ -8,5 +8,5 @@
   if (argc < 2) {
     fprintf (stderr, "USAGE: command <command> <arg>. ..\n");
-    fprintf (stderr, "  (define command machine for this task (or 'none'))\n");
+    fprintf (stderr, "  (define command for this task)\n");
     return (FALSE);
   }
Index: trunk/Ohana/src/opihi/pantasks/task_host.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/task_host.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/task_host.c	(revision 4705)
@@ -17,5 +17,5 @@
     fprintf (stderr, "  -required flags indicates controller must use this host\n");
     fprintf (stderr, "  value of 'local' for host indicates process not using controller\n");
-    fprintf (stderr, "  value of 'none' for host indicates controller may assign at will\n");
+    fprintf (stderr, "  value of 'anyhost' for host indicates controller may assign at will\n");
     return (FALSE);
   }
@@ -23,6 +23,9 @@
   task = GetNewTask ();
   if (task == NULL) {
-    fprintf (stderr, "ERROR: not defining or running a task\n");
-    return (FALSE);
+    task = GetActiveTask ();
+    if (task == NULL) {
+      fprintf (stderr, "ERROR: not defining or running a task\n");
+      return (FALSE);
+    }
   }
   task[0].host_required = RequiredHost;
@@ -36,2 +39,4 @@
   return (TRUE);
 }
+
+/* apparently, local is the default! */
Index: trunk/Ohana/src/opihi/pantasks/task_macros.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/task_macros.c	(revision 4697)
+++ trunk/Ohana/src/opihi/pantasks/task_macros.c	(revision 4705)
@@ -62,10 +62,10 @@
   }
   if (!strcmp (argv[0], "task.exit") && !strcmp (argv[1], "default")) {
-    if (task[0].def != NULL) {
-      FreeMacro (task[0].def);
-      free (task[0].def);
+    if (task[0].defexit != NULL) {
+      FreeMacro (task[0].defexit);
+      free (task[0].defexit);
     }
-    ALLOCATE (task[0].def, Macro, 1);
-    macro = task[0].def;
+    ALLOCATE (task[0].defexit, Macro, 1);
+    macro = task[0].defexit;
     macro[0].name = strcreate ("default");
     goto found;
