Click here to get back home

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

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
problem starting perl script from cron environment - ps: don't know which terminal to select Micha 03-19-2008
Posted by Micha on March 19, 2008, 8:24 am
Please log in for more thread options
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

Posted by Maxwell Lol on March 19, 2008, 12:53 pm
Please log in for more thread options

> 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.....


Posted by Micha on March 19, 2008, 2:05 pm
Please log in for more thread options
> > 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.

Posted by Henry Law on March 23, 2008, 9:01 am
Please log in for more thread options
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

Similar ThreadsPosted
shutdown of linux box from cron perl script January 7, 2005, 12:58 am
Re: shutdown of linux box from cron perl script January 7, 2005, 1:02 am
FAQ: I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? October 6, 2004, 4:54 pm
FAQ 8.34: I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? November 3, 2004, 12:03 am
FAQ 8.34: I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? November 9, 2004, 6:03 am
FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? March 26, 2005, 12:03 am
FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? June 1, 2005, 11:03 pm
FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? October 19, 2005, 4:03 am
FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? November 17, 2005, 5:03 am
FAQ 8.34 I {changed directory, modified my environment} in a perl script. How come the change disappeared when I exited the script? How do I get my changes to be visible? September 10, 2006, 3:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap