PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > problem starting perl script from cron environment - ps: don't knowwhich terminal to select
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

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

Réponse
 
LinkBack Outils de la discussion
Vieux 19/03/2008, 13h24   #1
Micha
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut problem starting perl script from cron environment - ps: don't knowwhich terminal to select

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
  Réponse avec citation
Vieux 19/03/2008, 17h53   #2
Maxwell Lol
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: problem starting perl script from cron environment - ps: don't know which terminal to select

Micha <michael.andrassy@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.....

  Réponse avec citation
Vieux 19/03/2008, 19h05   #3
Micha
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: problem starting perl script from cron environment - ps: don'tknow which terminal to select

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.
  Réponse avec citation
Vieux 23/03/2008, 14h01   #4
Henry Law
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 08h31.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11393 seconds with 12 queries