Index: /trunk/Ohana/src/opihi/lib.data/precess.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.data/precess.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/lib.data/precess.c	(revision 16472)
@@ -30,5 +30,5 @@
   if (!done) {
     gprint (GP_ERR, "error finding epoch %s\n", in_epoch);
-    exit (0);
+    return FALSE;
   }
   
Index: /trunk/Ohana/src/opihi/lib.shell/SocketOps.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/SocketOps.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/lib.shell/SocketOps.c	(revision 16472)
@@ -36,5 +36,5 @@
   if (!status) {
     gprint (GP_ERR, "invalid address\n");
-    exit (2);
+    exit (4);
   }
 # endif
@@ -45,5 +45,5 @@
   if (InitSocket == -1) {
     perror ("socket: ");
-    exit (2);
+    exit (5);
   }
 
@@ -72,9 +72,12 @@
     if (errno == EADDRINUSE) {
 	Address[0].sin_port ++;
-	if (Address[0].sin_port > MY_PORT + 10) exit (2);
+	if (Address[0].sin_port > MY_PORT + 10) {
+	  fprintf (stderr, "failed to find a usable port\n");
+	  exit (6);
+	}
 	goto retry_server;
     }
     perror ("bind: ");
-    exit (2);
+    exit (7);
   }
   /* repeated starts of the server are limited by xinetd or something:
@@ -85,5 +88,5 @@
   if (status == -1) {
     perror ("listen: ");
-    exit (2);
+    exit (8);
   }
   return (InitSocket);
@@ -109,5 +112,5 @@
   if (BindSocket == -1) {
     perror ("accept: ");
-    exit (2);
+    exit (9);
   }
 
@@ -175,5 +178,5 @@
   if (!status) {
     gprint (GP_ERR, "invalid address\n");
-    exit (2);
+    exit (10);
   }
 
@@ -183,5 +186,5 @@
   if (InitSocket == -1) {
     perror ("socket: ");
-    exit (2);
+    exit (11);
   }
 
@@ -190,9 +193,9 @@
     if (errno == ECONNREFUSED) {
       Address.sin_port ++;
-      if (Address.sin_port > MY_PORT + 10) exit (2);
+      if (Address.sin_port > MY_PORT + 10) exit (12);
       goto retry_client;
     }
     perror ("connect: ");
-    exit (2);
+    exit (13);
   }
 
@@ -222,5 +225,5 @@
   if (!status) {
     gprint (GP_ERR, "invalid address\n");
-    exit (2);
+    exit (14);
   }
 
@@ -230,5 +233,5 @@
   if (InitSocket == -1) {
     perror ("socket: ");
-    exit (2);
+    exit (15);
   }
 
@@ -237,5 +240,5 @@
   if (status == -1) {
     perror ("bind: ");
-    exit (2);
+    exit (16);
   }
 
@@ -243,5 +246,5 @@
   if (status == -1) {
     perror ("listen: ");
-    exit (2);
+    exit (17);
   }
 
@@ -269,5 +272,5 @@
     if (!test) {
       gprint (GP_ERR, "invalid IP address %s\n", string);
-      exit (2);
+      exit (18);
     }
     VALID[Nvalid] = ip1 | (ip2 << 8) | (ip3 << 16) | (ip4 << 24);
Index: /trunk/Ohana/src/opihi/lib.shell/multicommand.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/multicommand.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/lib.shell/multicommand.c	(revision 16472)
@@ -12,5 +12,5 @@
     /* check if down? */
     fprintf (stderr, "error: server fd already defined\n");
-    exit (1);
+    exit (30);
   }
 
@@ -18,5 +18,5 @@
   if (VarConfig ("PANTASKS_SERVER", "%s", hostname) == NULL) {
     gprint (GP_ERR, "pantasks server host undefined\n");
-    exit (2);
+    exit (31);
   }
 
@@ -71,5 +71,5 @@
 	      case EPIPE:
 		gprint (GP_ERR, "server connection has died\n");
-		exit (1);
+		exit (32);
 	      default:
 		gprint (GP_ERR, "server is busy...\n");
@@ -84,5 +84,5 @@
 	      case EPIPE:
 		gprint (GP_ERR, "server connection has died\n");
-		exit (1);
+		exit (33);
 	      default:
 		gprint (GP_ERR, "server is busy...\n");
@@ -99,5 +99,5 @@
 	      case EPIPE:
 		gprint (GP_ERR, "server connection has died\n");
-		exit (1);
+		exit (34);
 	      default:
 		gprint (GP_ERR, "server is busy...\n");
@@ -114,5 +114,5 @@
 	      case EPIPE:
 		gprint (GP_ERR, "server connection has died\n");
-		exit (1);
+		exit (35);
 	      default:
 		gprint (GP_ERR, "server is busy...\n");
Index: /trunk/Ohana/src/opihi/lib.shell/opihi.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/opihi.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/lib.shell/opihi.c	(revision 16472)
@@ -17,5 +17,5 @@
   Nbad = 0;
   while (1) {  /** must exit with command "exit" or "quit" */
-    if (Nbad == 10) exit (3);
+    if (Nbad == 10) exit (20);
 
     line = readline (prompt);
@@ -26,7 +26,7 @@
       if (ppid == 1) {
 	gprint (GP_ERR, "caught parent shutdown\n");
-	exit (2);
+	exit (21);
       }
-      if (!isatty (STDIN_FILENO)) exit (2);
+      if (!isatty (STDIN_FILENO)) exit (21);
       gprint (GP_LOG, "Use \"quit\" to exit\n");
       Nbad ++;
Index: /trunk/Ohana/src/opihi/lib.shell/startup.c
===================================================================
--- /trunk/Ohana/src/opihi/lib.shell/startup.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/lib.shell/startup.c	(revision 16472)
@@ -155,6 +155,6 @@
 
     /* if this is not an interactive session, exit here */
-    if (ONLY_INPUT) exit (2);
-    if (is_script) exit (2);
+    if (ONLY_INPUT) exit (40);
+    if (is_script) exit (41);
     return;
 }
Index: /trunk/Ohana/src/opihi/pcontrol/GetJobOutput.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/GetJobOutput.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/pcontrol/GetJobOutput.c	(revision 16472)
@@ -62,4 +62,4 @@
 
   gprint (GP_ERR, "programming error: should not reach here (GetJobOutput)\n");
-  pcontrol_exit (1);
+  pcontrol_exit (50);
 }
Index: /trunk/Ohana/src/opihi/pcontrol/HostOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/HostOps.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/pcontrol/HostOps.c	(revision 16472)
@@ -40,5 +40,5 @@
   }
   gprint (GP_ERR, "error: unknown host stack : programming error\n");
-  pcontrol_exit (1);
+  pcontrol_exit (51);
   return (NULL);
 }
@@ -53,5 +53,5 @@
   }
   gprint (GP_ERR, "error: unknown host stack : programming error\n");
-  pcontrol_exit (1);
+  pcontrol_exit (52);
   return (NULL);
 }
Index: /trunk/Ohana/src/opihi/pcontrol/JobOps.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/JobOps.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/pcontrol/JobOps.c	(revision 16472)
@@ -44,5 +44,5 @@
   }
   gprint (GP_ERR, "error: unknown host stack : programming error\n");
-  pcontrol_exit (1);
+  pcontrol_exit (53);
   return (NULL);
 }
@@ -58,5 +58,5 @@
   }
   gprint (GP_ERR, "error: unknown job stack : programming error\n");
-  pcontrol_exit (1);
+  pcontrol_exit (54);
   return (NULL);
 }
Index: /trunk/Ohana/src/opihi/pcontrol/ResetJob.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/ResetJob.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/pcontrol/ResetJob.c	(revision 16472)
@@ -43,10 +43,10 @@
     default:
       gprint (GP_ERR, "unknown status for pclient command: programming error\n");  
-      pcontrol_exit (1);
+      pcontrol_exit (55);
   }
 
   gprint (GP_ERR, "programming error in ResetJob (should not reach here)\n");
   FreeIOBuffer (&buffer);
-  pcontrol_exit (1);
+  pcontrol_exit (56);
   return (FALSE);
 }
Index: /trunk/Ohana/src/opihi/pcontrol/StopHosts.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/StopHosts.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/pcontrol/StopHosts.c	(revision 16472)
@@ -92,5 +92,5 @@
     default:
       gprint (GP_ERR, "unknown status for pclient command: programming error\n");  
-      pcontrol_exit (1);
+      pcontrol_exit (57);
   }
   HarvestHost (host[0].pid);
@@ -140,5 +140,5 @@
       if (result != pid) {
 	gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
-	pcontrol_exit (1);
+	pcontrol_exit (58);
       }
       
@@ -151,5 +151,5 @@
       if (WIFSTOPPED(waitstatus)) {
         gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
-	pcontrol_exit (1);
+	pcontrol_exit (59);
       }
   }
Index: /trunk/Ohana/src/opihi/pcontrol/rconnect.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/rconnect.c	(revision 16471)
+++ /trunk/Ohana/src/opihi/pcontrol/rconnect.c	(revision 16472)
@@ -58,5 +58,5 @@
     status = execvp (argv[0], argv); 
     gprint (GP_ERR, "error starting remote shell process\n");
-    pcontrol_exit (1);
+    pcontrol_exit (60);
   }
   free (argv);
@@ -122,5 +122,5 @@
   if ((result == -1) && (errno != ECHILD)) {
     gprint (GP_ERR, "unexpected error from waitpid (%d): programming error\n", errno);
-    pcontrol_exit (1);
+    pcontrol_exit (61);
   }
   if (result == 0) {
@@ -130,9 +130,9 @@
     if (result != pid) {
       gprint (GP_ERR, "waitpid error: mis-matched PID (%d vs %d).  programming error\n", result, pid);
-      pcontrol_exit (1);
+      pcontrol_exit (62);
     }
     if (WIFSTOPPED(waitstatus)) {
       gprint (GP_ERR, "waitpid returns 'stopped': programming error\n");
-      pcontrol_exit (1);
+      pcontrol_exit (63);
     }
   }
