Always need to run: source ~/.bashrc

Bug #444454 reported by actionparsnip
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openssh (Ubuntu)
Expired
Low
Unassigned

Bug Description

Whatever client and from whatever system (I use connectbot from my G1 phone and putty from windows) the ~/.bashrc file is never automatically processed. I have to manually run:

source ~/.bashrc

and then everything is as it should be.

andy@fileserver:~$ ls -la ~/.bashrc
-rw-r--r-- 1 andy andy 2224 2009-09-18 11:04 /home/andy/.bashrc
andy@fileserver:~$ whoami
andy

So I have correct access to the file but it simply refuses to autorun when i SSH in. It is also not a misconfigured client as I have tried 2 different clients.

I also noticed that the title bar on putty changes from "fileserver" to "andy@fileserver"

I connect using:

putty -X andy@fileserver 2200

ProblemType: Bug
Architecture: amd64
Date: Tue Oct 6 11:34:52 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: openssh-server 1:5.1p1-6ubuntu1
ProcEnviron:
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-10.35-generic
SourcePackage: openssh
Uname: Linux 2.6.31-10-generic x86_64

Revision history for this message
actionparsnip (andrew-woodhead666) wrote :
Revision history for this message
Thierry Carrez (ttx) wrote :

Can't reproduce this. My .bashrc is properly sourced on SSH logins.

Changed in openssh (Ubuntu):
importance: Undecided → Low
Revision history for this message
actionparsnip (andrew-woodhead666) wrote :

Even from windows clients via putty?

Revision history for this message
Achim Bohnet (allee) wrote :

I can't confirm this from linux -> (k)ubuntu

Please check that

1) your .bash_profile or .bash_login or .profile (1st file found is used) sources your .bashrc. Interative shells source .bashrc, login shells instead one of the 3 files above. If it does, attach the used file.

2) 'ps $$' lists -bash If it is not what's the output?

Revision history for this message
actionparsnip (andrew-woodhead666) wrote :

andy@fileserver:~$ ls .bash*
.bash_history .bashrc

From the local machine:
andy@fileserver:~$ ps $$
  PID TTY STAT TIME COMMAND
 5303 pts/0 Rs 0:00 [bash]

I will run the same command BEFORE running: source ~/.bashrc from the remote system and provide the output.

Thanks for the suggestion.

Revision history for this message
actionparsnip (andrew-woodhead666) wrote :

From G1 phone using connectbot:

andy@fileserver:~$ ps $$
  PID TTY STAT TIME COMMAND
25803 pts/1 Rs 0:00 -bash

and is same after running: source ~/.bashrc

May affect it but I reduced the number of ttys to 2 instead of keeping the usual 6 that come as part of a stock install. Would this affect it?

Revision history for this message
Achim Bohnet (allee) wrote :

You showed us that you have no .bash_profile and .bash_profile, now do you have a ~/.profile?

If yes: is .bashrc sourced in .profile? if not: add it (see /etc/skel/.profile how to do it)

if you have no .profile, copy /etc/skel/.profile to $HOME/ and be happy not to be forced to souece bashrc explicitly ;)

Achim

Revision history for this message
actionparsnip (andrew-woodhead666) wrote :

By jove he cracked it. Lack of ~/.profile screwing things up. Copied /etc/skel/.profile and was fine and dandy

Thanks a wole lot Achim. Good work :D

Revision history for this message
Achim Bohnet (allee) wrote :

Thx ;) As it's not an ssh bug I convert it to a question. (Never did before... exploring new launchpad features ... ;)

Achim

Revision history for this message
Colin Watson (cjwatson) wrote : Re: [Bug 444454] Re: Always need to run: source ~/.bashrc

On Fri, Oct 09, 2009 at 08:08:30AM -0000, Achim Bohnet wrote:
> You showed us that you have no .bash_profile and .bash_profile, now do
> you have a ~/.profile?
>
> If yes: is .bashrc sourced in .profile? if not: add it (see
> /etc/skel/.profile how to do it)
>
> if you have no .profile, copy /etc/skel/.profile to $HOME/ and be happy
> not to be forced to souece bashrc explicitly ;)

Did you read my previous comment which notes that according to the bash
documentation this is not supposed to be necessary?

       Bash attempts to determine when it is being run with its standard input
       connected to a a network connection, as if by the remote shell daemon,
       usually rshd, or the secure shell daemon sshd. If bash determines it
       is being run in this fashion, it reads and executes commands from
       ~/.bashrc and ~/.bashrc, if these files exist and are readable. It
       will not do this if invoked as sh. The --norc option may be used to
       inhibit this behavior, and the --rcfile option may be used to force
       another file to be read, but rshd does not generally invoke the shell
       with those options or allow them to be specified.

Chuck Short (zulcss)
Changed in openssh (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for openssh (Ubuntu) because there has been no activity for 60 days.]

Changed in openssh (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.