[GE users] problems with load sensor

Olesen, Mark Mark.Olesen at arvinmeritor.com
Thu Apr 28 14:58:43 BST 2005


I used to have a load sensor written in perl and didn't have any particular
problems.  For other reasons I've switched over to having /bin/sh and call
perl as required.

Were you reading from stdin?
Eg,

    while ( defined( $_ = <STDIN> ) ) {
        /^(exit|quit|stop)/ and exit 0;    # only 'quit' is required

        print "begin\n";
        generate_output($licenses);
        print "end\n";
    }
    exit 1;


Perhaps it might also help if you starting your perl program indirectly via
/bin/sh might do the trick.
Eg,

-cut-cut-cut-cut-cut-cut-cut-cut-
: # -*- perl -*-
eval 'exec perl -wS $0 "$@"'    # /bin/sh should exec 'perl'
unless 1;                     # but Perl should skip this one
 
use strict;
...
-cut-cut-cut-cut-cut-cut-cut-cut-


I personally like this method, since it a) automagically finds perl
somewhere in the path and b) it allows environment variable to be
conveniently set!
Eg,

-cut-cut-cut-cut-cut-cut-cut-cut-
: # -*- perl -*-

: ${SGE_ROOT:=/opt/n1ge6}
: ${SGE_CELL:=default}
: ${SGE_ARCH:=`$SGE_ROOT/util/arch`}

for i in $SGE_ROOT/$SGE_CELL/site/environ.sh
do
  [ -f $i ] && . $i
done


eval 'exec perl -wx -S $0 "$@"'    # /bin/sh should exec 'perl'
unless 1;                     # but Perl should skip this one
 
# perl entry point
#!/usr/bin/perl -w
use strict;
...
-cut-cut-cut-cut-cut-cut-cut-cut-




/mark


> -----Original Message-----
> From: Andreas Haupt [mailto:ahaupt at ifh.de]
> Sent: Thursday, April 28, 2005 3:31 PM
> To: users at gridengine.sunsource.net
> Subject: Re: [GE users] problems with load sensor
> 
> Hello,
> 
> On Tue, 26 Apr 2005, Andreas Haupt wrote:
> 
> > On Tue, 26 Apr 2005, Reuti wrote:
> >> Can you try to list only the hostname in the load sensor, instead of
> the
> >> FQDN and see the result? - Reuti
> >
> > Nothing changed...
> 
> I finally found the problem. SGE doesn't like Perl. I rewrote the load
> sensor. It now uses /bin/sh and everything works fine (Yes, the output
> of both scripts is identical!).
> 
> Is there somewhere documented if I can use Perl at all?
> 
> Greetings
> Andreas
> 
> --
> | Andreas Haupt                      | E-Mail:  andreas.haupt at desy.de
> |  DESY Zeuthen                      | WWW:     http://www.desy.de/~ahaupt
> |  Platanenallee 6                   | Phone:   +49/33762/7-7359
> |  D-15738 Zeuthen                   | Fax:     +49/33762/7-7216
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
> For additional commands, e-mail: users-help at gridengine.sunsource.net

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list