3

I am following these steps to setup a Jenkins server on an Ubuntu EC2 instance.

Everything is fine until I get to this step:

enter image description here

As you can see (at the end of the output) I am being asked for the password for the jenkins user. It is my understanding that the jenkins user is not an interactive user thus doesn't have a normal password. Am I mistaken?

ubuntu@ip-xxx-xxx-xxx-xxx:~$ sudo su jenkins
jenkins@ip-xxx-xxx-xxx-xxx:/home/ubuntu$ curl -L https://get.rvm.io | bash -s stable --ruby
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   184  100   184    0     0    257      0 --:--:-- --:--:-- --:--:--   345
100 20572  100 20572    0     0  21776      0 --:--:-- --:--:-- --:--:-- 21776
Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz

Upgrading the RVM installation in /var/lib/jenkins/.rvm/
    RVM PATH line found in /var/lib/jenkins/.bashrc /var/lib/jenkins/.zshrc.
    RVM sourcing line found in /var/lib/jenkins/.bash_profile /var/lib/jenkins/.zlogin.
Upgrade of RVM in /var/lib/jenkins/.rvm/ is complete.

# Jenkins-ci,
#
#   Thank you for using RVM!
#   We sincerely hope that RVM helps to make your life easier and more enjoyable!!!
#
# ~Wayne, Michal & team.

In case of problems: http://rvm.io/help and https://twitter.com/rvm_io

Upgrade Notes:

  * No new notes to display.


rvm 1.24.7 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

Searching for binary rubies, this might take some time.
Found remote file https://rvm.io/binaries/ubuntu/12.04/x86_64/ruby-2.0.0-p353.tar.bz2
Checking requirements for ubuntu.
Installing requirements for ubuntu.
jenkins password required for 'apt-get --quiet --yes update':
Braiam
  • 4,777
CaymanEss
  • 131

3 Answers3

3

Looks like the rvm installer is trying to run apt-get to install missing dependencies, we can fix that by pre installing them. Try running this as root:

sudo apt-get install curl bison build-essential zlib1g-dev libssl-dev libreadline5-dev libxml2-dev git-core

And now try running your install command again as the Jenkins user.

1

The password here asked is for sudo, this allows the installation script to execute apt-get. Either you should execute it yourself with a user that has root permissions or temporally add the jerkins user to the sudoers and allow it to execute apt-get or give it a temporal password. Those are the 3 ways I see.

Braiam
  • 4,777
0

The other solution is to download the ruby manually and stick it in the archive folder of the Jenkins home .rvm folder. Rvm looks there before trying to download a ruby. As far as I know you can only su to the Jenkins user, and you probably shouldn't try to get around that.