IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4451


Ignore:
Timestamp:
Jul 4, 2005, 6:29:10 PM (21 years ago)
Author:
eugene
Message:

fixed up some bugs

Location:
trunk/Ohana/src/opihi
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/CheckJobs.c

    r4450 r4451  
    3434
    3535      case JOB_CRASH:
    36         fprintf (stderr, "job %s (%d) crash\n", job[0].task[0].name, job[0].JobID);
    3736        /* run task[0].crash macro, if it exists */
    3837        /* set the stdout and stderr variables with job.stdout, job.stderr */
    3938        /* XXX this will break on 0 values in output streams */
     39        fprintf (stderr, "job %s (%d) crash\n", job[0].task[0].name, job[0].JobID);
    4040        set_str_variable ("stdout", job[0].stdout.buffer);
    4141        set_str_variable ("stderr", job[0].stderr.buffer);
     
    4949      case JOB_EXIT:
    5050        fprintf (stderr, "job %s (%d) exit\n", job[0].task[0].name, job[0].JobID);
     51        set_str_variable ("stdout", job[0].stdout.buffer);
     52        set_str_variable ("stderr", job[0].stderr.buffer);
    5153        /* run corresponding task[0].exit macro, if it exists */
    5254        macro = job[0].task[0].def;
  • trunk/Ohana/src/opihi/pantasks/ControllerOps.c

    r4450 r4451  
    6464  char *p;
    6565  IOBuffer buffer;
    66  
    6766
    6867  sprintf (cmd, "check job %d", job[0].pid);
     
    179178  job[0].pid = atoi (string);
    180179  FreeIOBuffer (&buffer);
     180
     181  InitIOBuffer (&job[0].stdout, 0x100);
     182  InitIOBuffer (&job[0].stderr, 0x100);
    181183  return (TRUE);
    182184}
  • trunk/Ohana/src/opihi/pantasks/LocalJob.c

    r4450 r4451  
    1515  pid = fork ();
    1616  if (!pid) { /* must be child process */
    17     fprintf (stderr, "starting controller connection\n");
     17    fprintf (stderr, "starting local job\n");
    1818
    1919    /* close the other ends of the pipes */
     
    4545  job[0].pid = pid;
    4646
     47  InitIOBuffer (&job[0].stdout, 0x100);
     48  InitIOBuffer (&job[0].stderr, 0x100);
    4749  return (TRUE);
    4850
  • trunk/Ohana/src/opihi/pantasks/task.c

    r3907 r4451  
    1 # include "basic.h"
    21# include "scheduler.h"
    32# define prompt "> "
  • trunk/Ohana/src/opihi/pantasks/task_command.c

    r4450 r4451  
    1 # include "basic.h"
    21# include "scheduler.h"
    32
  • trunk/Ohana/src/opihi/pantasks/task_host.c

    r4450 r4451  
    1 # include "basic.h"
    21# include "scheduler.h"
    32
  • trunk/Ohana/src/opihi/pantasks/task_macros.c

    r3907 r4451  
    1 # include "basic.h"
    21# include "scheduler.h"
    32# define D_NLINES 100
  • trunk/Ohana/src/opihi/pantasks/task_periods.c

    r2598 r4451  
    1 # include "basic.h"
    21# include "scheduler.h"
    32
  • trunk/Ohana/src/opihi/scripts/sched.pro

    r2598 r4451  
    11
    2 task foo
    3   command ls foo baz
    4   periods -poll 2.0
    5   periods -exec 1.0
    6   periods -timeout 5.0
    7   host kiawe
     2task test
     3  command sched.test
     4  periods -poll 1.0
     5  periods -exec 2.0
     6  periods -timeout 2.0
     7  host local
     8  # local is default
     9
     10  task.exec
     11    echo "starting job sched.test"
     12  end
    813
    914  task.exit 0
     15    echo stdout: $stdout
     16    echo stderr: $stderr
     17    exec echo "foo bar" >> failure.log
     18    output test.log
     19    echo $stdout
     20    output stdout
    1021    echo "successful job"
    1122  end
    1223
    1324  task.exit 1
     25    echo stdout: $stdout
     26    echo stderr: $stderr
    1427    echo "failed job"
    1528  end
     
    2235    echo "job timed out"
    2336  end
    24 
    25   task.exec
    26     echo "starting job foo"
    27   end
    2837end
Note: See TracChangeset for help on using the changeset viewer.