Index: /trunk/Ohana/src/opihi/pantasks/delete.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/delete.c	(revision 13541)
+++ /trunk/Ohana/src/opihi/pantasks/delete.c	(revision 13542)
@@ -3,15 +3,45 @@
 int delete_job (int argc, char **argv) {
 
+  Job *job;
   int JobID;
 
-  if (argc < 2) {
-    gprint (GP_ERR, "USAGE: delete (JobID)\n");
+  if (argc != 3) goto usage;
+
+  if (!strcasecmp (argv[1], "job")) {
+    JobID = atoi (argv[2]);
+
+    job = FindJob (JobID);
+    if (job == NULL) {
+      gprint (GP_LOG, "job not found\n");
+      return (TRUE);
+    }
+
+    if (job[0].mode == JOB_LOCAL) {
+      if (!KillLocalJob (job)) {
+	job[0].state = JOB_HUNG;
+	if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
+	return (FALSE);
+      }
+    } else {
+      if (!KillControllerJob (job)) {
+	job[0].state = JOB_HUNG;
+	if (VerboseMode()) gprint (GP_LOG, "child process %d is hung, cannot kill\n", job[0].pid);
+	return (FALSE);
+      }
+    }    
+    DeleteJob (job);
+    gprint (GP_LOG, "job removed\n");
+    return (TRUE);
+  }
+
+  if (!strcasecmp (argv[1], "task")) {
+    gprint (GP_ERR, "delete task not implemented yet\n");
     return (FALSE);
   }
-  JobID = atoi (argv[1]);
-  /* use a string interp to convert JobIDs to ints ? */
 
-  gprint (GP_ERR, "this function is not yet implemented\n");
-  return (TRUE);
+usage:
+    gprint (GP_ERR, "USAGE: delete job (JobID)\n");
+    gprint (GP_ERR, "USAGE: delete task (TaskName)\n");
+    return (FALSE);
 }
 
Index: /trunk/Ohana/src/opihi/pantasks/kill.c
===================================================================
--- /trunk/Ohana/src/opihi/pantasks/kill.c	(revision 13541)
+++ /trunk/Ohana/src/opihi/pantasks/kill.c	(revision 13542)
@@ -13,4 +13,8 @@
 
   job = FindJob (JobID);
+  if (job == NULL) {
+    gprint (GP_LOG, "job not found\n");
+    return (TRUE);
+  }
 
   if (job[0].mode == JOB_LOCAL) {
@@ -27,6 +31,6 @@
     }
   }    
-    
-  gprint (GP_ERR, "this function is not yet implemented\n");
+  DeleteJob (job);
+  gprint (GP_LOG, "job removed\n");
   return (TRUE);
 }
