Topic
  • 2 replies
  • Latest Post - ‏2013-03-24T15:01:54Z by BMerrill
SystemAdmin
SystemAdmin
150 Posts

Pinned topic Output from perl script doesn't always appear in JobRunner log

‏2013-03-13T22:13:33Z |
Has anyone had the experience that when calling a perl script from JobRunner XML, what perl writes to stdout/stderr sometimes appears in the JobRunner log, and sometimes doesn't? This isn't an issue of the "joblogShowStepOutput" attribute; I have that set to "true". I get the impression that the problem may be timing related. I tried forcing perl to flush the output, first using autoflush, then forcibly closing STDOUT and STDERR, with no luck. Finally I added a 5 second delay after closing STDOUT/STDERR, and now it seems to reliably include the output in the JobRunner log, but I can't prove I have solved the problem. By the way, I'm using TUAM 7.3.
Updated on 2013-03-24T15:01:54Z at 2013-03-24T15:01:54Z by BMerrill
  • BMerrill
    BMerrill
    19 Posts

    Re: Output from perl script doesn't always appear in JobRunner log

    ‏2013-03-13T23:01:28Z  
    You are not alone. I have experienced this problem. It started with a shell script and when I translated the script to perl, I get the same result. Most of the time the console output is captured in the jobrunner log but not all the time.
  • BMerrill
    BMerrill
    19 Posts

    Re: Output from perl script doesn't always appear in JobRunner log

    ‏2013-03-24T15:01:54Z  
    I'm not sure if you found a solution. It seems we both experience the issue. I found this in the SampleRunScript.xml. I'm sure you have #!/bin/sh or #!/usr/perl, but this might give you an idea.

    Additional notes about the contents of the shell script:
    1. Start your shell script with "#!/bin/sh"
    The script file that Job Runner calls should start with this line:
    #!/bin/sh
    When Job Runner runs a script that does NOT start with that line, Job Runner
    will most likely fail with a "No step output" error.

    The "No step output" error occurs because a script that does not start with
    "#!/bin/sh" inherits environment variable values from TUAM's Embedded WebSphere
    (eWAS) environment rather than the environment variable values that are seen
    in a typical UNIX terminal session. For example, the SHELL and SHELLOPTS
    environment variable values look similar to this for a sample RedHat Enterprise
    Linux 5 terminal session:
    SHELL=/bin/bash
    SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor

    On the other hand, the SHELL and SHELLOPTS environment variable values look
    similar to this for TUAM's eWAS environment:
    SHELL=com.ibm.ws.management.tools.WsServerLauncher
    SHELLOPTS=braceexpand:hashall:interactive-comments:posix