Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > problem starting perl script from cron environment - ps: don't knowwhich terminal to select

Reply
Thread Tools

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

 
 
Micha
Guest
Posts: n/a
 
      03-19-2008
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
 
Reply With Quote
 
 
 
 
Micha
Guest
Posts: n/a
 
      03-19-2008
On 19 Mrz., 17:53, Maxwell Lol <nos...@com.invalid> wrote:
> Micha <michael.andra...@gmail.com> 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.
 
Reply With Quote
 
 
 
 
Henry Law
Guest
Posts: n/a
 
      03-23-2008
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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C++ 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui C Programming 0 04-27-2009 12:51 PM
3 ESSENTIAL TOOLS FOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLSFOR STARTING AND MAINTAINING...3 ESSENTIAL TOOLS FOR STARTING ANDMAINTAINING... Oanh Bui Python 0 04-27-2009 12:46 PM
running perl script in cron Edward Perl Misc 1 05-13-2004 05:11 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57