Changeset 10694 for trunk/Ohana/src/opihi/pantasks/controller_run.c
- Timestamp:
- Dec 13, 2006, 8:55:19 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/controller_run.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/controller_run.c
r8548 r10694 7 7 IOBuffer buffer; 8 8 9 if (argc != 1) { 10 gprint (GP_ERR, "USAGE: controller run\n"); 9 if ((argc > 2) || 10 get_argument (argc, argv, "help") || 11 get_argument (argc, argv, "-h") || 12 get_argument (argc, argv, "--help")) 13 { 14 if (!strcmp (argv[0], "run")) { 15 gprint (GP_ERR, "USAGE: controller run [level]\n"); 16 gprint (GP_ERR, " allowed levels:\n"); 17 gprint (GP_ERR, " all (default) : manage machines, spawn jobs, harvest jobs\n"); 18 gprint (GP_ERR, " reap : manage machines, harvest jobs\n"); 19 gprint (GP_ERR, " hosts : manage machines, not jobs\n"); 20 gprint (GP_ERR, " none : all stop\n"); 21 } else { 22 gprint (GP_ERR, "USAGE: controller stop (immediate processing halt)\n"); 23 } 11 24 return (FALSE); 12 25 } … … 19 32 } 20 33 21 sprintf (command, "run"); 34 if (argc == 1) { 35 strcpy (command, argv[0]); 36 } else { 37 sprintf (command, "run %s", argv[1]); 38 } 39 22 40 InitIOBuffer (&buffer, 0x100); 23 41 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer); … … 30 48 return (TRUE); 31 49 } 32 33 int controller_stop (int argc, char **argv) {34 35 int status;36 char command[1024];37 IOBuffer buffer;38 39 if (argc != 1) {40 gprint (GP_ERR, "USAGE: controller stop\n");41 return (FALSE);42 }43 44 /* check if controller is running */45 status = CheckControllerStatus ();46 if (!status) {47 gprint (GP_LOG, "controller is not active\n");48 return (TRUE);49 }50 51 sprintf (command, "stop");52 InitIOBuffer (&buffer, 0x100);53 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer);54 if (status) {55 gwrite (buffer.buffer, 1, buffer.Nbuffer, GP_LOG);56 } else {57 gprint (GP_LOG, "controller is not responding\n");58 }59 FreeIOBuffer (&buffer);60 return (TRUE);61 }
Note:
See TracChangeset
for help on using the changeset viewer.
