Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24762 - bash related : ssh does not source ~/.bashrc by default. PVM breaks
Summary: bash related : ssh does not source ~/.bashrc by default. PVM breaks
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Daniel Ahlberg (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-18 12:33 UTC by Jean-François Richard
Modified: 2003-10-20 00:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-François Richard 2003-07-18 12:33:04 UTC
This is declared in config-top.h when compiling bash :  
 
/* Define this if you want bash to try to check whether it's being run by 
   sshd and source the .bashrc if so (like the rshd behavior). */ 
/* #define SSH_SOURCE_BASHRC */ 
 
Perhaps it is good for security reasons, but when we run PVM (clustering app), it 
breaks things.  
 
PVM uses ssh to spawn daemons on several other hosts.  It tries to run 
${PVM_ROOT}/lib/pvmd after it ssh-ed on a host.  pvmd then needs a local 
${PVM_ROOT} env. var to start.  Thus, it needs the env. variable to be set on each 
host it connects to. 
 
Unfortunately, when ssh-ing to a box, bash does not source ~/.bashrc because of 
this option, like it would with rsh. 
 
For now we need to hand-compile bash to work around this stopper... 
 
What do you think?  Perhaps a USE flag for this? :S 
 
 

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 solar (RETIRED) gentoo-dev 2003-09-28 13:33:44 UTC
Jean-Fran
Comment 2 solar (RETIRED) gentoo-dev 2003-09-28 13:33:44 UTC
Jean-François Richard,
Please attach a patch if you would like this functionality.

You could do this simple as 
use bashrc && append-flags -DSSH_SOURCE_BASHRC
and we might/could add a new local use flag for bash.

or you could sed -e s:"/* #define SSH_SOURCE_BASHRC */":"#define SSH_SOURCE_BASHRC":g

attaching a patch either way will greatly improve the chances of getting
this added.
Comment 3 Daniel Ahlberg (RETIRED) gentoo-dev 2003-10-13 08:11:14 UTC
Added to -r8. 
Comment 4 Toby Dickenson 2003-10-20 00:11:43 UTC
This looks like the wrong way to solve this problem.

bash run from sshd is not a special case. Currently .bashrc isnt run for
shells started out of xterms, konsole, etc, either. We need a solution for
all of these, not just ssh.

(and once the rest are fixed, this patch to bash will be a liability. we
dont want .bashrc run twice for each login)

There is a solution to all of these in bug #26952.