[Beowulf] rsh don't see the real variables

Robert G. Brown rgb at phy.duke.edu
Sat Oct 9 15:32:14 PDT 2004


On Sat, 9 Oct 2004, Gustavo Gobi Martinelli wrote:

> 
> I'm trying to make the pvm 3.4.5 work, but I'm having a problem with "rsh".
> 
> if I execute the command:
> 
> # rsh 192.168.0.2 'set'
> 
> I will see a list of variables that isn't in the .bash_profile of root user.
> 
> But, if I execute this:
> 
> # rsh 192.168.0.1
> 
> the login occurs and I can execute
> 
> # set
> 
> Now, I can see the variable that I need.
> 
> What did happen? How can I find the local where I can declare the variables that
> will be appear with " rsh 192.168.0.1 'set' " command?
> 
> Because this, the PVM doesn't work. It needs see $PVM_ROOT variable that exists
> in .bash_profile but not in "rsh" session.
> 
> Someone know anything about it? I'm using the Fedora Core 2 with kernel 2.6.7.

Use ssh, and look into the environment commands.  rsh has many flaws,
one of which is a failure to pass environment variables at all sanely
from the calling host.  So this is one way to proceed.

Also note (from man bash):

       When bash is invoked as an interactive login shell, or as a
non-inter-
       active shell with the --login option, it first reads and executes
com-
       mands from the file /etc/profile, if that file exists.  After
reading
       that file, it looks for ~/.bash_profile, ~/.bash_login, and
~/.profile,
       in that order, and reads and executes commands from the first one
that
       exists and is readable.  The --noprofile option may be used when
the
       shell is started to inhibit this behavior.

In other words, there is a difference between the behavior of an
interactive shell (what you get when you execute rsh hostname to log in)
and a non-interactive shell -- they actually read and execute different
.??* files in a different order.  In fact, you can control the order to
some extent with the call syntax.  Assuming that you're using bash, you
might read the man page carefully and experiment -- if you put the
requisite environment variable definitions in the right place you should
still be able to have them initialized even over rsh, as long as you
don't have to pass them via the remote shell itself.  If you do, you'll
NEED to look into ssh in more detail.

HTH,

   rgb

> 
> --
> Atenciosamente,
> Gustavo Gobi Martinelli
> Linux User# 270627
> _______________________________________________
> Beowulf mailing list, Beowulf at beowulf.org
> To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf
> 

Robert G. Brown	                       http://www.phy.duke.edu/~rgb/
Duke University Dept. of Physics, Box 90305
Durham, N.C. 27708-0305
Phone: 1-919-660-2567  Fax: 919-660-2525     email:rgb at phy.duke.edu





More information about the Beowulf mailing list