Bug 1171 - rsh won't run /etc/profile script when running program
rsh won't run /etc/profile script when running program
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: rsh (Show other bugs)
5.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Nalin Dahyabhai
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-02-15 10:33 EST by kenc
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-04-09 14:42:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description kenc 1999-02-15 10:33:45 EST
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 14:42:59 EDT
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 01:16:59 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.