[GE users] How to set default env vars in SGE?

mhanby mhanby at uab.edu
Thu Mar 19 17:58:36 GMT 2009


Update on this issue. I set up a virtual test cluster this week and ran
into the same problem. It turns out that I needed to add bash to the
login_shells configuration parameter. Once I did that, whatever I
specify in /etc/bashrc gets applied to the job environment properly
(assuming you specify bash as your shell for the job).

qconf -mconf

login_shells                 bash,sh,ksh,csh,tcsh



-----Original Message-----
From: reuti [mailto:reuti at staff.uni-marburg.de] 
Sent: Friday, February 13, 2009 5:47 AM
To: users at gridengine.sunsource.net
Subject: Re: [GE users] How to set default env vars in SGE?

Hi,

Am 12.02.2009 um 18:50 schrieb mhanby:

> Ok, I take that back, sourcing the script in ~/.bash_profile does not
> work for non interactive jobs:
>
> . /etc/profile.d/modules.sh

correct. Non-interactive jobs won't source anything. Only parallel  
ones would source the ~/.bashrc for slave processes.

You could use a starter_method in the queue definition:

#!/bin/sh
. /etc/profile.d/modules.sh
exec "$@"

-- Reuti


> Nor does adding it to the global /etc/bashrc or even /etc/profile  
> on all
> the compute nodes. On one of our other older Rocks clusters, it  
> works if
> I add it to the /etc/bashrc file and not in the job script.
>
> I must have something configured wrong with regards to ssh?
>
> The following are set in qconf -sconf:
>
> qlogin_command               /opt/gridengine/bin/rocks-qlogin.sh
> rsh_command                  /usr/bin/ssh
> rlogin_command               /usr/bin/ssh
> rsh_daemon                   /usr/sbin/sshd -i -o Protocol=2
> qlogin_daemon                /usr/sbin/sshd -i -o Protocol=2
> rlogin_daemon                /usr/sbin/sshd -i -o Protocol=2
>
> qrsh_command                 /usr/bin/ssh
> rsh_command                  /usr/bin/ssh
> rlogin_command               /usr/bin/ssh
> rsh_daemon                   /usr/sbin/sshd
> qrsh_daemon                  /usr/sbin/sshd
>
> Strange that rsh_command, rlogin_command, rsh_daemon are in there  
> twice.
> The older cluster has these set for qconf -sconf
>
> qlogin_command               /ibrixfs/apps/gridengine/ 
> qlogin_wrapper.sh
> qlogin_daemon                /usr/sbin/sshd -i
> rlogin_command               /usr/bin/ssh -t
> rlogin_daemon                /usr/sbin/sshd -i
> rsh_daemon                   /usr/sbin/sshd -i
> rsh_command                  /usr/bin/ssh -t
>
> -----Original Message-----
> From: mhanby [mailto:mhanby at uab.edu]
> Sent: Tuesday, February 03, 2009 3:36 PM
> To: users at gridengine.sunsource.net
> Subject: RE: [GE users] How to set default env vars in SGE?
>
> Thanks, I put them into /etc/profile.d/ on the compute nodes / head
> node, however that doesn't appear to work for non interactive jobs
> (works fine for qrsh).
>
> I'll try sourcing them in /etc/profile and see if that works.
>
> It does work if I source it in my own .bash_profile, however I'd  
> like to
> configure this globally for all users.
>
> Dan I'll take a look at customizing the custom starter script.
>
> Thanks for the feedback.
>
> Mike
>
> -----Original Message-----
> From: hugo_hernandez [mailto:hugo.hernandez at loni.ucla.edu]
> Sent: Tuesday, February 03, 2009 1:10 PM
> To: users at gridengine.sunsource.net
> Cc: users at gridengine.sunsource.net
> Subject: Re: [GE users] How to set default env vars in SGE?
>
> Hello Mike,
> Why not you use the global profiles to source these files: /etc/
> login.cshrc or /etc/.profile (if tcsh or bash is used). To source and
> define user stuff we usually do this way.
> I hope it can help.
> -Hugo
>
>
> On Feb 3, 2009, at 2:01 PM, "mhanby" <mhanby at uab.edu> wrote:
>
>> Howdy,
>>
>> We are trying to get our users to use the 'module load <module-name>'
>> system of configuring their environment within their job scripts.
>>
>> In an effort to make this easier on them, is there a way for me to
>> configure SGE (6.1) so that all user jobs automatically source the
>> module env script:
>>
>> /etc/profile.d/modules.csh
>> or for bash
>> /etc/profile.d/modules.sh
>>
>> These files exist on all of the compute nodes and the SGE server.
>> Currently, I have instructed them to source the shell relevant  
>> modules
>> file in their job script, however most forget and end up with errors
>> stating that module isn't a valid command.
>>
>> Thanks for any insight.
>>
>> Mike
>>
>> ------------------------------------------------------
>>
> http://gridengine.sunsource.net/ds/viewMessage.do? 
> dsForumId=38&dsMessage
> Id=101740
>>
>> To unsubscribe from this discussion, e-mail:
> [users-unsubscribe at gridengine.sunsource.net
>> ].
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do? 
> dsForumId=38&dsMessage
> Id=101744
>
> To unsubscribe from this discussion, e-mail:
> [users-unsubscribe at gridengine.sunsource.net].
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do? 
> dsForumId=38&dsMessage
> Id=101774
>
> To unsubscribe from this discussion, e-mail:
> [users-unsubscribe at gridengine.sunsource.net].
>
> ------------------------------------------------------
> http://gridengine.sunsource.net/ds/viewMessage.do? 
> dsForumId=38&dsMessageId=104184
>
> To unsubscribe from this discussion, e-mail: [users- 
> unsubscribe at gridengine.sunsource.net].
>

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessage
Id=104810

To unsubscribe from this discussion, e-mail:
[users-unsubscribe at gridengine.sunsource.net].

------------------------------------------------------
http://gridengine.sunsource.net/ds/viewMessage.do?dsForumId=38&dsMessageId=136754

To unsubscribe from this discussion, e-mail: [users-unsubscribe at gridengine.sunsource.net].



More information about the gridengine-users mailing list