1

I'm using hss (https://github.com/six-ddc/hss) to connect to 3 Ubuntu servers (the same edition). The problem is on 2 of them ~/.bash_profile is not read over hss, even though it is being read when I ssh in individually to each.

$ env | grep -w PATH
[O] root@example-sql -> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
[O] root@example-www -> PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
[O] root@example-search -> PATH=.:/root/bin:/usr/local/node/bin:...

example-search does read .bash_profile apparently, because there are additional directories that I added to PATH, like /root/bin, etc. The first two, however, do not seem to.

Why is that happening? How can I fix that (I want PATH the way I defined it, obviously).

UPDATE

I have checked for sourcing ~/.bashrc by adding touch /tmp/something on 'problem' host and then running some commands over hss. It does NOT source .bashrc on first 2 hosts.

LetMeSOThat4U
  • 1,371
  • 2
  • 17
  • 35

1 Answers1

1

Executing a command remotely over ssh (or, in this case with hss), does NOT create an interactive login shell. This means that it will not read .bash_profile, but it DOES use .bashrc.

I think you should look at .bashrc on your three hosts and see if there are differences. Perhaps .bashrc on that host is also sourcing .bash_profile? Or, the PATH you are looking for is already in .bashrc on that one host?

guzzijason
  • 1,410
  • 8
  • 18