Changeset 4575
- Timestamp:
- Jul 16, 2005, 11:01:59 AM (21 years ago)
- Location:
- trunk/Ohana/src/opihi/pcontrol
- Files:
-
- 1 added
- 9 edited
-
CheckBusyJob.c (modified) (2 diffs)
-
CheckDoneHost.c (modified) (6 diffs)
-
CheckHost.c (modified) (3 diffs)
-
GetJobOutput.c (modified) (2 diffs)
-
Makefile (modified) (1 diff)
-
StartHost.c (modified) (1 diff)
-
StartJob.c (modified) (5 diffs)
-
init.c (modified) (2 diffs)
-
rconnect.c (modified) (3 diffs)
-
verbose.c (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/CheckBusyJob.c
r4450 r4575 34 34 35 35 case PCLIENT_GOOD: 36 /* fprintf (stderr, "message received (CheckBusyJob)\n"); */36 if (VerboseMode()) fprintf (stderr, "message received (CheckBusyJob)\n"); 37 37 break; 38 38 39 39 default: 40 fprintf (stderr, " unknown status for pclient command: programming error\n");40 fprintf (stderr, "programming error: unknown status for pclient command\n"); 41 41 exit (1); 42 42 } … … 45 45 p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer); 46 46 if (p == NULL) { 47 fprintf (stderr, " missing STATUS in pclient message : programming error\n");47 fprintf (stderr, "programming error: missing STATUS in pclient message\n"); 48 48 exit (1); 49 49 } 50 50 sscanf (p, "%*s %s", string); 51 51 if (!strcmp(string, "NONE")) { 52 fprintf (stderr, " no current job : programming error\n");52 fprintf (stderr, "programming error: no current job\n"); 53 53 exit (1); 54 54 } -
trunk/Ohana/src/opihi/pcontrol/CheckDoneHost.c
r3212 r4575 16 16 /** do we need to close the connection? **/ 17 17 PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM); 18 fprintf (stderr, "host %s is down\n", host[0].hostname);18 if (VerboseMode()) fprintf (stderr, "host %s is down\n", host[0].hostname); 19 19 FreeIOBuffer (&buffer); 20 20 return (FALSE); … … 22 22 case PCLIENT_HUNG: 23 23 PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM); 24 fprintf (stderr, "host %s is not responding\n", host[0].hostname);24 if (VerboseMode()) fprintf (stderr, "host %s is not responding\n", host[0].hostname); 25 25 FreeIOBuffer (&buffer); 26 26 return (FALSE); 27 27 28 28 case PCLIENT_GOOD: 29 fprintf (stderr, "message received (CheckDoneHost)\n");29 if (VerboseMode()) fprintf (stderr, "message received (CheckDoneHost)\n"); 30 30 break; 31 31 32 32 default: 33 fprintf (stderr, "unknown status for pclient command: programming error\n");33 if (VerboseMode()) fprintf (stderr, "unknown status for pclient command: programming error\n"); 34 34 exit (1); 35 35 } … … 38 38 p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer); 39 39 if (p == NULL) { 40 fprintf (stderr, " missing STATUS in pclient message : programming error in CheckDoneHost\n");40 fprintf (stderr, "programming error: missing STATUS in pclient message (CheckDoneHost)\n"); 41 41 exit (1); 42 42 } … … 44 44 switch (status) { 45 45 case -1: 46 fprintf (stderr, " reset syntax error : programmingerror\n");46 fprintf (stderr, "programming error: reset syntax error\n"); 47 47 exit (1); 48 48 49 49 case 0: 50 fprintf (stderr, "reset failed\n");50 if (VerboseMode()) fprintf (stderr, "reset failed\n"); 51 51 PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM); 52 52 FreeIOBuffer (&buffer); … … 55 55 case 1: 56 56 case 2: 57 fprintf (stderr, "successful reset\n");57 if (VerboseMode()) fprintf (stderr, "successful reset\n"); 58 58 PutHost (host, PCONTROL_HOST_IDLE, STACK_BOTTOM); 59 59 FreeIOBuffer (&buffer); … … 61 61 62 62 default: 63 fprintf (stderr, "programming error in CheckDoneHost (should not reach here)\n");63 fprintf (stderr, "programming error: should not reach here (CheckDoneHost)\n"); 64 64 exit (1); 65 65 } 66 fprintf (stderr, "programming error in CheckDoneHost (should not reach here either)\n");66 fprintf (stderr, "programming error: should not reach here either (CheckDoneHost)\n"); 67 67 exit (1); 68 68 } -
trunk/Ohana/src/opihi/pcontrol/CheckHost.c
r4450 r4575 12 12 switch (status) { 13 13 case 0: 14 fprintf (stderr, "host %s is down\n", host[0].hostname);14 if (VerboseMode()) fprintf (stderr, "host %s is down\n", host[0].hostname); 15 15 16 16 /* if host has a job, job is dead, push to Pending */ … … 33 33 34 34 case -1: 35 fprintf (stderr, "host %s is not responding\n", host[0].hostname);35 if (VerboseMode()) fprintf (stderr, "host %s is not responding\n", host[0].hostname); 36 36 /*** do we mark this in some way (HUNG) ? ***/ 37 37 PutHost (host, host[0].stack, STACK_BOTTOM); … … 40 40 41 41 default: 42 /* fprintf (stderr, "host %s is alive\n", host[0].hostname); */42 if (VerboseMode()) fprintf (stderr, "host %s is alive\n", host[0].hostname); 43 43 PutHost (host, host[0].stack, STACK_BOTTOM); 44 44 FreeIOBuffer (&buffer); 45 45 return (TRUE); 46 46 } 47 fprintf (stderr, "programming error (Check Host)\n");47 fprintf (stderr, "programming error: should not reach here (Check Host)\n"); 48 48 return (FALSE); 49 49 } -
trunk/Ohana/src/opihi/pcontrol/GetJobOutput.c
r4573 r4575 38 38 switch (status) { 39 39 case -1: 40 fprintf (stderr, "host %s is not responding\n", host[0].hostname);40 if (VerboseMode()) fprintf (stderr, "host %s is not responding\n", host[0].hostname); 41 41 return (FALSE); 42 42 43 43 case 0: 44 fprintf (stderr, "host %s is down\n", host[0].hostname);44 if (VerboseMode()) fprintf (stderr, "host %s is down\n", host[0].hostname); 45 45 return (FALSE); 46 46 47 47 default: 48 fprintf (stderr, "message received (GetJobOutput : %s)\n", cmd);48 if (VerboseMode()) fprintf (stderr, "message received (GetJobOutput : %s)\n", cmd); 49 49 /* drop extra bytes from pclient (not pclient:job) */ 50 50 buffer[0].Nbuffer = Nstart + Nbytes; … … 55 55 } 56 56 57 fprintf (stderr, "programming error in GetJobOutput (should not reach here)\n");57 fprintf (stderr, "programming error: should not reach here (GetJobOutput)\n"); 58 58 exit (1); 59 59 } -
trunk/Ohana/src/opihi/pcontrol/Makefile
r4450 r4575 50 50 51 51 cmds = \ 52 $(SDIR)/job.$(ARCH).o \ 53 $(SDIR)/host.$(ARCH).o \ 52 54 $(SDIR)/kill.$(ARCH).o \ 53 55 $(SDIR)/delete.$(ARCH).o \ 54 56 $(SDIR)/check.$(ARCH).o \ 55 $(SDIR)/job.$(ARCH).o \56 57 $(SDIR)/status.$(ARCH).o \ 57 58 $(SDIR)/stdout.$(ARCH).o \ 58 $(SDIR)/ host.$(ARCH).o59 $(SDIR)/verbose.$(ARCH).o 59 60 60 61 pcontrol = $(cmds) $(funcs) -
trunk/Ohana/src/opihi/pcontrol/StartHost.c
r3211 r4575 14 14 pid = rconnect (command, host[0].hostname, shell, stdio); 15 15 if (!pid) { /** failure to start **/ 16 fprintf (stderr, "failure to start %s\n", host[0].hostname);16 if (VerboseMode()) fprintf (stderr, "failure to start %s\n", host[0].hostname); 17 17 PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM); 18 18 return (FALSE); -
trunk/Ohana/src/opihi/pcontrol/StartJob.c
r4450 r4575 13 13 host = (Host *) job[0].host; 14 14 if (host == NULL) { 15 fprintf (stderr, " no assigned host : programming error\n");15 fprintf (stderr, "programming error: no assigned host\n"); 16 16 exit (1); 17 17 } … … 36 36 switch (status) { 37 37 case PCLIENT_DOWN: 38 fprintf (stderr, "host %s is down\n", host[0].hostname);38 if (VerboseMode()) fprintf (stderr, "host %s is down\n", host[0].hostname); 39 39 goto failure; 40 40 41 41 case PCLIENT_HUNG: 42 fprintf (stderr, "host %s is not responding\n", host[0].hostname);42 if (VerboseMode()) fprintf (stderr, "host %s is not responding\n", host[0].hostname); 43 43 goto failure; 44 44 45 45 case PCLIENT_GOOD: 46 fprintf (stderr, "message received (StartJob)\n");46 if (VerboseMode()) fprintf (stderr, "message received (StartJob)\n"); 47 47 break; 48 48 49 49 default: 50 fprintf (stderr, "unknown status for pclient command: programming error\n");50 if (VerboseMode()) fprintf (stderr, "unknown status for pclient command: programming error\n"); 51 51 exit (1); 52 52 } … … 55 55 p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer); 56 56 if (p == NULL) { 57 fprintf (stderr, " missing STATUS in pclient message : programming error\n");57 fprintf (stderr, "programming error: missing STATUS in pclient message\n"); 58 58 exit (1); 59 59 } … … 61 61 switch (status) { 62 62 case -1: 63 fprintf (stderr, "error in pclient child\n");63 if (VerboseMode()) fprintf (stderr, "error in pclient child\n"); 64 64 goto failure; 65 65 66 66 case -2: 67 fprintf (stderr, " syntax error in pclient command : programming error\n");67 fprintf (stderr, "programming error: syntax error in pclient command\n"); 68 68 exit (1); 69 69 70 70 case -3: 71 fprintf (stderr, " existing child on pclient : programming error\n");71 fprintf (stderr, "programming error: existing child on pclient\n"); 72 72 exit (1); 73 73 … … 81 81 } 82 82 /* we should never reach here */ 83 fprintf (stderr, "p control programming error\n");83 fprintf (stderr, "programming error: should not reach here (StartJob)\n"); 84 84 exit (1); 85 85 -
trunk/Ohana/src/opihi/pcontrol/init.c
r4450 r4575 7 7 int check PROTO((int, char **)); 8 8 int status PROTO((int, char **)); 9 int verbose PROTO((int, char **)); 9 10 int stdout_pc PROTO((int, char **)); 10 11 int stderr_pc PROTO((int, char **)); … … 19 20 {"stdout", stdout_pc, "get stdout buffer for job"}, 20 21 {"stderr", stderr_pc, "get stderr buffer for job"}, 22 {"verbose", verbose, "set the verbose mode for job"}, 21 23 }; 22 24 -
trunk/Ohana/src/opihi/pcontrol/rconnect.c
r4573 r4575 27 27 argv[2] = shell; 28 28 argv[3] = 0; 29 fprintf (stderr, "%s %s %s\n", argv[0], argv[1], argv[2]);30 29 31 30 pid = fork (); 32 31 if (!pid) { /* must be child process */ 33 fprintf (stderr, "starting remote connection to %s...", hostname);32 if (VerboseMode()) fprintf (stderr, "starting remote connection to %s...", hostname); 34 33 35 34 /* close the other ends of the pipes */ … … 79 78 status = ReadtoIOBuffer (&buffer, stdout_fd[0]); 80 79 p = memstr (buffer.buffer, "CONNECTED", buffer.Nbuffer); 81 /* fprintf (stderr, "%d %d %s\n", i, buffer.Nbuffer, buffer.buffer); */82 80 usleep (20000); 83 81 } 84 fprintf (stderr, "%d cycles to connect\n", i);82 if (VerboseMode()) fprintf (stderr, "%d cycles to connect\n", i); 85 83 if (status == 0) goto pipe_error; 86 84 if (status == -1) goto io_error; 87 85 FreeIOBuffer (&buffer); 88 86 89 fprintf (stderr, "Connected\n");87 if (VerboseMode()) fprintf (stderr, "Connected\n"); 90 88 91 89 stdio[0] = stdin_fd[1]; … … 100 98 101 99 io_error: 102 fprintf (stderr, "timeout while connecting\n");100 if (VerboseMode()) fprintf (stderr, "timeout while connecting\n"); 103 101 goto close_pipes; 104 102
Note:
See TracChangeset
for help on using the changeset viewer.
