Bug 1171

Summary: rsh won't run /etc/profile script when running program
Product: [Retired] Red Hat Linux Reporter: kenc
Component: rshAssignee: Nalin Dahyabhai <nalin>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-04-09 18:42:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description kenc 1999-02-15 15:33:45 UTC
using rsh to run a program on a remote system is awkward
because the user shell is run in nonlogin, noninteractive
mode, which means it never executes /etc/profile which
usually means the $PATH variable is not set up.  Interesting
enough it runs just fine when rsh is used to simply bring up
an intereactive shell.  First observed when running between
two machines, but problem can be demonstrated on single
machine by rshing to itself.

rsh localhost
brings up a shell that has everything setup properly.

rsh localhost "echo $PATH"
shows only the default user/bin:/bin path.

I have worked around this by having the /etc/bashrc script
invoke the /etc/profile script if it hasn't been run yet.
But that really shouldn't be necessary.

Comment 1 Jeff Johnson 1999-04-09 18:42:59 UTC
This is actually a bash (started up by rsh) problem.
The behavior is annoying, but well known (and well documented).

Comment 2 vallon 1999-04-21 05:16:59 UTC
This is actually the standard behavior of rsh (rshd).  If given a
command, rsh(d) executes the command directly, without running a login
shell.  If not given a command, rsh reverts to rlogin(d), which in
turn runs a login shell which, for bash, runs /etc/profile and
~/.bash_profile.