[GE users] Réf. : Re: [GE users] Qrsh and PATH variable

Andy Schwierskott andy.schwierskott at sun.com
Fri Jun 15 09:10:03 BST 2007


Dan,

to my knowledge login.conf is not sourced by any shell. The login program
should process this file as it is the parent process of a login shell.
Therefore settings in that file have no effect for jobs started by SGE.

Without changing the source code I think my suggestion to modify the
"environment" file by a prolog is the only solution.

Thierry, please file an RFE about your need where you describe what you need
to achieve.

Andy

> Thierry,
>
> You're correct.  I forgot about PATH and LOGNAME being explicitly overridden. 
> Before we start changing source code, though, I still think there's a simpler 
> answer.
>
> Let's go back to login.conf for a second.  Forgive my Solaris-only ignorance, 
> but what shell sources /etc/login.conf?  I see that tcsh looks at /etc/.login 
> and /etc/csh.login, but I can't find any mention in the Solaris sh, csh, 
> tcsh, bash, ksh, or zsh man pages of /etc/login.conf.  How is it that 
> /etc/login.conf is being sourced into your shell's environment normally?
>
> Daniel
>
> Thierry Darnige wrote:
>> Thanks Daniel,
>>  My actual problem is this piece of code in sge_execd (in exec_job.c, PATH 
>> and LOGNAME variables seem to be handled differently than others): 
>> If ((user_path=lGetElemStr(environmentList, VA_variable, "PATH")))
>>             Sge_dstring_sprintf(&buffer, "%s:%s", tmpdir, 
>> lGetString(user_path, VA_value));
>>          Else
>>             Sge_dstring_sprintf(&buffer, "%s:%s", tmpdir, 
>> SGE_DEFAULT_PATH);
>>         Var_list_set_string(&environmentList, "PATH", 
>> sge_dstring_get_string(&buffer));
>>         Sge_dstring_free(&buffer);
>> In other words, I understand that if there is job defined PATH using the 
>> "-v" option in qrsh, it is concatenated to the tmpdir to form the PATH.
>> Else the tmpdir is concatenated with a DEFAULT_PATH 
>> (/usr/local/bin:/bin:/usr/bin that is hard-coded).
>> I would expect a concatenation with $PATH to get the current context PATH 
>> ...
>>  All this is written in an "environment" file, read by sge_starter that 
>> overrides the PATH just before executing the job.
>> INHERIT_ENV to FALSE doesn't solve the problem because it doesn't apply to 
>> PATH and LOGNAME.
>>  Seems that my only solution is to change the source ... Unless there is a 
>> mechanism I don't see (It's an obvious behaviour for me. Strange it's not 
>> handled).
>>  Thierry.
>>    /-------Message original-------/
>>  /*De :*/ Daniel Templeton <mailto:Dan.Templeton at Sun.COM>
>> /*Date :*/ 13/06/2007 19:16:59
>> /*A :*/ users at gridengine.sunsource.net 
>> <mailto:users at gridengine.sunsource.net>
>> /*Sujet :*/ Re: [GE users] Qrsh and PATH variable
>>  Also, keep in mind that by default, the base environment for a job is
>> the environment of the user that started the execution daemon.  It gets
>> overridden, of course, by some Grid Engine environment settings, the
>> contents of the users profile, and any job-specific environment
>> settings, such as those from using -v as Andy described.  To start with
>> a completely blank environment, set INHERIT_ENV to FALSE in the
>> execd_params.
>>  Daniel
>>  Andy Schwierskott wrote:
>> > Thierry,
>> >
>> > if the current PATH should be exported you'd just type in
>> >
>> >    qrsh -v PATH
>> >
>> > to be verified by:
>> >
>> >     qrsh '/bin/echo $PATH'
>> >     qrsh -v PATH '/bin/echo $PATH'
>> >
>> > Andy
>> >
>> >
>> > On Wed, 13 Jun 2007, Thierry Darnige wrote:
>> >
>> >> Hello,
>> >>
>> >> I'm using sge6 on netbsd and experiments some problems with the qrsh
>> >> command
>> >> (redirected to ssh) and the PATH variable :
>> >>
>> >> I just want to be able to issue a command like "qrsh matlab" on any node
>> >> (the used PATH is then the node environment variable grabbed from
>> >> /etc/login
>> >> conf) and avoid to give the absolute path for matlab.
>> >>
>> >> SGE seems to overload the node PATH with a default (what I've
>> >> confirmed with
>> >> a quick look to the code). Nevertheless, the user can specify his own
>> >> PATH
>> >> through a "-V" option in the qrsh command but it's longer to type
>> >> than using
>> >> the absolute path.
>> >>
>> >> Do you know a more "userfriendly" way to do that ? I'm sure I'm missing
>> >> something ...
>> >>
>> >> Thank you

---------------------------------------------------------------------
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