On Feb 24, 2005, at 11:08 PM, Zachary Pincus wrote:
> So now the question is which dotfiles do bash or tcsh run when invoked
> non-interactively (which is how sshd invokes them when it uses the
> shell to execute a command). A quick trip to the bash and tcsh man
> pages answers this question:
> man tcsh:
>> Non-login shells read only /etc/csh.cshrc and ~/.tcshrc or ~/.cshrc
> The bash man page is less clear, but it appears that .bashrc is read
> when rshd (or, presumably, sshd) executes bash:
>> Bash attempts to determine when it is being run by the remote
>> daemon, usually rshd. If bash determines it is being run by rshd,
>> reads and executes commands from ~/.bashrc, if that file exists and
> So in either case, the .bashrc or .tcshrc file should be invoked,
> provided that sshd is in fact running the command from a shell (I
> think there are ways to configure it to not do so, but they are not
> common, and then in that case the error message would be 'sshd:
> svnserve: command not found' or something similar, not 'tcsh:...'.)
> Likewise, etc/bashrc and etc/csh.cshrc get read in either case.
On our machines, we have never observed .tcshrc being run when using
ssh in this manner. Adding the svn path to PATH in this manner was not
effective. Our bash users reported the same thing. Weird.
> The reason this bites Mac users particularly is that many have
> installed subverison via fink, which puts it in /sw/bin. This needs a
> special PATH entry, which sometimes ends up in a .login or .profile
It also bites if you installed from the Installer packages that are
linked to from the main svn page. They install into /usr/local/bin,
which Apple for some reason has not made a standard search location.
> Now, we can easily test the claim that (at least with tcsh), sshd does
> in fact invoke tcsh in such a manner that it reads the .tcshrc file in
> my home directory:
> 1) Note that I've installed svn via fink, so it lives in /sw/bin. The
> only place that '/sw/bin' is added to my path is in a single line my
> ~/.tchsrc on the machine that is the subversion server. (I grep -r'd
> etc/* for any mention of /sw/, and there was none.)
> 2) With this single line intact in the ~/.tchsrc, something like: 'svn
> ls svn+ssh://host/repository' works.
> 3) When I comment out the single line in the .tcshrc file that adds
> /sw/bin to the path, then the same command fails with the message
> 'tcsh: svnserve: Command not found.'
> 4) Restoring the line restores svn functionality.
Not sure what to say about that. It did not work for us on 3 different
In any event, at least we have now documented all this in the list
archives. Maybe it will help others in the future...
To unsubscribe, e-mail: email@example.com
For additional commands, e-mail: firstname.lastname@example.org
Received on Fri Feb 25 17:40:01 2005