[Beowulf] Gridengine and bash + Modules

Brian Smith brs at usf.edu
Mon Jan 18 09:37:38 PST 2010


Ah, the RedHat-isms that we take for granted... hah!  I forgot that the
default ~/.bashrc I push out to everyone sources /etc/bashrc by default.
What distro are you using?

There's also this bit of goodness from the man page:

"Bash attempts to determine when it is being run with its standard input
connected  to a a network connection, as if by the remote shell daemon,
usually rshd, or the secure shell daemon sshd.  If bash  determines  it
is  being  run  in  this  fashion,  it reads and executes commands from
~/.bashrc, if that file exists and is readable.  It will not do this if
invoked as sh.  The --norc option may be used to inhibit this behavior,
and the --rcfile option may be used to force another file to  be  read,
but  rshd  does  not  generally  invoke the shell with those options or
allow them to be specified."

I wonder if sge_shepherd doesn't, in fact, trick shells into behaving
this way... I know I'm not using BASH_ENV and my modules environment
works correctly.


-Brian

-- 
Brian Smith
Senior Systems Administrator
IT Research Computing, University of South Florida
4202 E. Fowler Ave. ENB308
Office Phone: +1 813 974-1467
Organization URL: http://rc.usf.edu


On Mon, 2010-01-18 at 14:38 +0000, madskaddie at gmail.com wrote:
> 2010/1/16 Brian Smith <brs at usf.edu>:
> > I'm using this in our environment.  I've simply added the Modules
> > environment code to /etc/bashrc and /etc/csh.cshrc on all nodes (I use
> > puppet to manage everything, so this is easy).  This ensures that
> > Modules is properly integrated with your environment regardless of
> > whether you are using an interactive or non-interactive invocation of
> > these shells.  This works for SGE (I'm on 6.2u4, ATM)
> >
> 
> But it seems that gridengine spawns like "bash script_name" so no rc
> files are read. Reading bash manpage, I found the BASH_ENV environment
> variable:
> 
> """
> When  bash  is  started non-interactively, to run a shell script, for
> example, it looks for the variable BASH_ENV in the environment,
> expands its value if it appears there, and uses the expanded value as
> the name of a file to read and execute.  Bash behaves as if the
> following command were executed:
>               if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
> but the value of the PATH variable is not used to search for the file name.
> """
> (bash manpage)
> 
> Right now I'm setting this variable and with the "-V" job submission
> flag it's working well (it does not work correctly without it)
> 
> Gil
> 
> 




More information about the Beowulf mailing list