HOWTO Setup Jenkins on a Synology NAS (DS1511+)

DSM version: 3.1
For installing Jenkins you have to have java SDK installed on your Synology. A previous post was a HowTo install Java & Maven on a DS1511+  

The good thing about Jenkins is it does not need a container like Tomcat to run as it comes bundeld with winstone

Step 1, Create the user jenkins
Add the system users Jenkins as user number 145. Please make sure this user id is not used on your Synology!

Edit the /etc/password file
vi /etc/passwd

add the following line 

Edit the /etc/shadow file
vi /etc/shaddow

add the following line

Edit the /etc/group file
vi /etc/group

add the following line

Step 2, Create directory structure
Create the Jenkins home directory
cd /opt
mkdir jenkins
ln -s /opt/jenkins /var/lib/jenkins/

Create the Jenkins data directory
cd /opt/jenkins
mkdir data
chown jenkins:jenkins data

Step 3, Install the war file 
Download the latest Jenkins war file
cd /var/lib/jenkins/

Create a very simple startup script



su -s /bin/sh jenkins -c “
 cd /var/lib/jenkins
JENKINS_HOME=/var/lib/jenkins/data exec nohup /usr/java/bin/java  
-jar /var/lib/jenkins/jenkins.war          
</dev/null >>/var/lib/jenkins/data/console_log 2>&1 &
echo $! >/var/lib/jenkins/data/”


Make it executable
chmod 755

And run it for the first test run

Check for any errors in the log file
cat /var/lib/jenkins/data/console_log 


Open firefox and point it to http://<your DS1511+ ip>:8080/
and it should show the main page of jenkins 


Create a proper init.d start/stop script 
Anynone likes to contribute this? Please thanks in advance. 

Note it is possible you find the following error in your log:
java.lang.Error: Failed to create temporary file for jnidispatch library: Permission denied
It does not prevent jenkins form running, however if you dont like this, just make the war file writable for the jenkins user with: 
cd /var/lib/jenkins/
chown jenkins:jenkins jenkins.war




5 thoughts on “HOWTO Setup Jenkins on a Synology NAS (DS1511+)

  1. Sébastien

    Thanks ! It helps me :-)Could you comment this line ?jenkins:*:10933:0:99999:7:::I do not understand "</dev/null" in the scriptWhere can I found Jenkins options (ie: $JENKINS_OPTS) ?

  2. Sébastien

    You could find start/stop script here ;-)

  3. Pingback: Jenkins on Synology xx09 -Series

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s