problem starting perl script from cron environment - ps: don't knowwhich terminal to select

Discussion in 'Perl Misc' started by Micha, Mar 19, 2008.

  1. Micha

    Micha Guest

    I have perl program which works just fine on the console, but started
    in cron environment it prints "ps: don't know which terminal to
    select" to stderr - btw I don't call ps explicitly at any point in my
    scripts.

    Now lets have a look at the details :

    My script is written in perl, inside that script there is a call in
    backquotes to an other perl script which starts too.
    By printf-debugging I could find out that the "ps: don't know which
    terminal to select" output occurs both in the parent and child script
    before by first line of code. Does perl call ps before starting?? why
    does it need a terminal? my script do not process stdin and stdout +
    stderr are redirected into files. And for some reason this problem
    occurs only when calling a perl script from an other perl script.

    In interactive mode the script works just fine - I ran it from a ksh.
    To execute it via cron I write a small ksh script, which reads the
    environment from the .kshrc an the executes the per script sending
    stdout and stderr to log-files.

    Let me try to deconfuse it ;)

    Cron -> ksh-Script -> perlA -> perlB -> perlC

    -when calling perlA from ksh - ok, no message
    - when calling perlB from perlA or perlC from perlB - there
    is a stderr message "ps: don't know which terminal to select"
    which must be caused before my first line of code in the child
    script

    Thanks in advance, Micha
     
    Micha, Mar 19, 2008
    #1
    1. Advertising

  2. Micha

    Micha Guest

    Re: problem starting perl script from cron environment - ps: don'tknow which terminal to select

    On 19 Mrz., 17:53, Maxwell Lol <> wrote:
    > Micha <> writes:
    > > I have perl program which works just fine on the console, but started
    > > in cron environment it prints "ps: don't know which terminal to
    > > select" to stderr - btw I don't call ps explicitly at any point in my
    > > scripts.

    >
    > Cron doesn't.
    > perl doesn't.
    > Perhaps your ksh startup file calls it.....


    no it doesn't ;) - still wondering why, currently I'm using a
    workaround without cron. But somehow that problem still bothers me.
     
    Micha, Mar 19, 2008
    #2
    1. Advertising

  3. Micha

    Henry Law Guest

    Re: problem starting perl script from cron environment - ps: don'tknow which terminal to select

    Micha wrote:

    >> Perhaps your ksh startup file calls it.....

    >
    > no it doesn't ;) - still wondering why, currently I'm using a


    You say that, and indeed you may be right, but I'd encourage you to look
    at it again, since it seems to be the most likely cause of a call to a
    system utility which you've not coded. Remember that cron runs in quite
    a different environment to that in your terminal: it has its own set of
    environment variables, for example, and (I presume) could also have its
    own shell startup script.

    BTW unless it turns back into a Perl error pretty soon we should stop
    discussing in comp.lang.perl.misc! Set followups if appropriate.

    --

    Henry Law Manchester, England
     
    Henry Law, Mar 23, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Horst Walter

    Java Task / Cron environment

    Horst Walter, Mar 2, 2004, in forum: Java
    Replies:
    7
    Views:
    3,473
    Horst Walter
    Mar 4, 2004
  2. Stephen Cattaneo
    Replies:
    4
    Views:
    512
    Asun Friere
    Aug 19, 2008
  3. Cameron Simpson
    Replies:
    0
    Views:
    707
    Cameron Simpson
    Aug 18, 2008
  4. gaurav kashyap
    Replies:
    3
    Views:
    6,722
    Paul Boddie
    Oct 31, 2008
  5. Steve
    Replies:
    2
    Views:
    972
    edicionsdigitals.com edicions digitals xarxa socia
    Dec 7, 2010
Loading...

Share This Page