Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

1 like 0 dislike
297 views
in Others by
We are trying to install Jenkins into Ubuntu. But we are facing chellange with default jenkins installation that it forces us to create users. It will not allow us to install jenkins without setting up user account. So we have plans to use war file, jenkins.war, file with ubuntu. I need procedure with script to set Jenkins as startup program in Ubuntu machine.

3 Answers

0 like 0 dislike
by The go-to Tester (181 points)

Add commands to /etc/rc.local

$sudo vim /etc/rc.local

with content like the following.

# This script is executed at the end of each multiuser runlevel
java -jar /path/to/jenkins.war &   # Added by me
exit 0
0 like 0 dislike
by The go-to Tester (181 points)

Add an Upstart job.

Create /etc/init/myjob.conf

$sudo vim /etc/init/myjob.conf

with content like the following

description     "my job"
start on startup
task
java -jar /path/to/jenkins.war &
0 like 0 dislike
by

Also you can try add an initscript.

Create a new script in /etc/init.d/myscript.

sudo vim /etc/init.d/myscript

(Obviously it doesn't have to be called "myscript".) In this script, do whatever you want to do. Perhaps just run the script you mentioned.

#!/bin/sh
java -jar /path/to/jenkins.war &

Make it executable.

chmod ugo+x /etc/init.d/myscript

Configure the init system to run this script at startup.

update-rc.d myscript defaults


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...