Discussion:
Jenkins ssh into slave without executing .bashrc or .bash_profile as expected
hhuynh
2011-06-09 20:19:48 UTC
Permalink
Does anyone know what might be wrong when Jenkins won't run .bashrc
or .bash_profile after it ssh into a slave (Suse10 box)?

I have other redhat slaves configuring the same way and the .bashrc is
executed and printed out on Jenkins log but not this Suse10 box.
Fred Stluka
2011-06-09 20:40:40 UTC
Permalink
I ran into a similar situation involving bash and ssh (but not
Jenkins). Neither .bash_profile nor .bashrc ran when I used
the -t option on ssh to connect to a server as a user whose
default shell was bash. Here's what I learned, and my
workaround:


http://bristle.com/Tips/Unix.htm#use_scripts_for_frequent_ssh_access_to_bash

Maybe your problem is similar?

--Fred
---------------------------------------------------------------------
Fred Stluka -- mailto:fred-***@public.gmane.org -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
---------------------------------------------------------------------
Post by hhuynh
Does anyone know what might be wrong when Jenkins won't run .bashrc
or .bash_profile after it ssh into a slave (Suse10 box)?
I have other redhat slaves configuring the same way and the .bashrc is
executed and printed out on Jenkins log but not this Suse10 box.
hhuynh
2011-06-09 21:40:49 UTC
Permalink
Thanks Fred but that workaround doesn't help me with Jenkins setup.

There's no fields in Jenkins slave configurations to let you run any
command. Just hostname, username and password. Jenkins handles the ssh
completely from there.
Post by Fred Stluka
I ran into a similar situation involving bash and ssh (but not
Jenkins).  Neither .bash_profile nor .bashrc ran when I used
the -t option on ssh to connect to a server as a user whose
default shell was bash.  Here's what I learned, and my
http://bristle.com/Tips/Unix.htm#use_scripts_for_frequent_ssh_access_...
Maybe your problem is similar?
--Fred
---------------------------------------------------------------------
Bristle Software, Inc --http://bristle.com-- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
---------------------------------------------------------------------
Post by hhuynh
Does anyone know what might be wrong when Jenkins won't run .bashrc
or .bash_profile after it ssh into a slave (Suse10 box)?
I have other redhat slaves configuring the same way and the .bashrc is
executed and printed out on Jenkins log but not this Suse10 box.
Jesse Farinacci
2011-06-09 20:29:08 UTC
Permalink
Greetings,
Post by hhuynh
Does anyone know what might be wrong when Jenkins won't run .bashrc
or .bash_profile after it ssh into a slave (Suse10 box)?
Most likely a user error. Are you certain the $SHELL is bash on the
SuSE10 box? Is /etc/profile dramatically different?
Post by hhuynh
I have other redhat slaves configuring the same way and the .bashrc is
executed and printed out on Jenkins log but not this Suse10 box.
User error further confirmed that it is not likely to be a Jenkins
issue because you confirm it is working on other Linux slaves.

-Jesse
--
There are 10 types of people in this world, those
that can read binary and those that can not.
Sami Tikka
2011-06-12 20:08:27 UTC
Permalink
With high probability this is not a problem with Jenkins but in your slave host.

You should study the bash man page paying attention to which files bash executes for non-login, non-interactive shells. Then check those files and find why they don't work the way you expect them to.

IMHO bash does not execute .bashrc for non-interactive non-login shells. If it does on your other slaves, then they have something special in their bash.

By the way, are you sure the login shell is bash?

Sami
Post by hhuynh
Does anyone know what might be wrong when Jenkins won't run .bashrc
or .bash_profile after it ssh into a slave (Suse10 box)?
I have other redhat slaves configuring the same way and the .bashrc is
executed and printed out on Jenkins log but not this Suse10 box.
Alan Hu
2018-07-25 09:40:01 UTC
Permalink
Hi , Please disconnect and reconnect hudson slave, follow the steps
mentioned in the link below:

http://www.thinkplexx.com/learn/howto/build-chain/ci/configure-set-the-hudson-slave-environment



圚 2011幎6月10日星期五 UTC+8䞊午4:19:48hhuynh写道
Post by hhuynh
Does anyone know what might be wrong when Jenkins won't run .bashrc
or .bash_profile after it ssh into a slave (Suse10 box)?
I have other redhat slaves configuring the same way and the .bashrc is
executed and printed out on Jenkins log but not this Suse10 box.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-users+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8544578c-9751-43e2-8de0-cc2c5125a33f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...