Monday, April 18, 2011

Jenkins OSX installer

Two weeks ago, I started to work on a simple OSX installer for Jenkins. Last week my work was accepted by Kohsuke and submitted to the repository. Now you can find the installer for the lastest Jenkins release here.

What does the installer do?
  • copies the jenkins.war to /Applications/Jenkins
  • create a simple LaunchAgent property file (org.jenkins-ci.plist) and add Jenkins as a service
    with a specific JENKINS_HOME location in /Users/Shared/
  • start the new Jenkins service after the installation finished
That's it basically.

You can find the installer project on github.


Roey said...

How do I ininstall it from my mac?

Ingo said...

You probably want to un-install the stuff, right?
This is (very mac like) a manual process. I can send you the little script that I used for testing purpose. This will be included in one of the next releases of the installer.

BTW: there will be a new installer available soon, that allows the user to install only jenkins and another option to install it as auto start item.

Andrew said...

I used the stand-alone installer on the Jenkins site, and have no idea what it did other than put the .war in /Applications/Jenkins/ If there is some configuration file someplace that I will need to change (because I want to put the file elsewhere), where is it? What is it? Thanks for your work!

Ingo said...

Hi Andrew,

basically you are right about the installer. Currently it copies the war to /Applications/Jenkins and creates the configuration file for the LaunchService. You can find this file in /Library/LaunchAgents/org.jenkins-ci.plist.
This file contains the information about the jenkins.war file. So if you want to change the location, then you can modify it here.
The current installer leaves a lot of room for improvement. There is currently ome work in progress to have a Prefpane for jenkins. This will make changes to the configuration much easier.
If you have an idea for improvement, then drop me an email. I'm happy to get some feedback and make the appropriate changes to meet as much needs as possible.

Anonymous said...

I ran into an issue while trying to use your installer to build iOS apps. Essentially, the user running Jenkins (daemon I think) could not access the Keychain and hence the certificates that match the mobile provisioning profiles. I was getting errors like:

[BEROR]Code Sign error: a valid provisioning profile matching the application's Identifier ''

I solved this by running Jenkins as my user, with loads of credit to this blog post .

Just curious if you can think of a better way and also documenting a work around incase anyone else runs into the same issue.

Ingo said...

I'm glad that you found a work around for your issue.
Perhaps it's a good idea to create a new user to let jenkins run as. I haven't yet thought about this, since you are the first one that reports that kind of issues.
Sure, it would be a good idea in the meantime to add your solution to the readme.

blebaron said...

The installer is great. I had the same issue as @matyjas. Luckily I found this here so that I could get code signing to work.

cr381ve said...

Thank you very much works like a dream!

cr381ve said...

Note to change the port you just need to run the following command:

sudo defaults write /Library/Preferences/org.jenkins-ci httpPort '9990'

Steve G said...
This comment has been removed by the author.
Steve G said...
This comment has been removed by the author.
Steve G said...

After much playing around with and thinking the installer was broken I figured out my issue.

If you get this:
[Winstone 2011/11/03 16:01:00] - Container startup failed Failed to start a listener: winstone.ajp13.Ajp13Listener
at winstone.Launcher.spawnListener(
at winstone.Launcher.(
at winstone.Launcher.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at Main._main(
at Main.main(
Caused by: Failed to listen on port 8009
at winstone.ajp13.Ajp13Listener.start(
at winstone.Launcher.spawnListener(
... 8 more
Caused by: Address already in use
at Method)
at winstone.ajp13.Ajp13Listener.start(
... 9 more

Exception in thread "pool-2-thread-2" java.lang.NullPointerException
at org.jvnet.hudson.reactor.Reactor$
at org.jvnet.hudson.reactor.Reactor$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$
Nov 3, 2011 4:01:00 PM hudson.WebAppMain$2 run
SEVERE: Failed to initialize Jenkins
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(
at org.jvnet.hudson.reactor.Reactor.execute(
at jenkins.model.Jenkins.executeReactor(
at jenkins.model.Jenkins.(
at hudson.model.Hudson.(
at hudson.model.Hudson.(
at hudson.WebAppMain$
Exception in thread "pool-2-thread-1" java.lang.NullPointerException
at org.jvnet.hudson.reactor.Reactor$
at org.jvnet.hudson.reactor.Reactor$
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$

change the ajp13port to something else.....

sudo defaults write /Library/Preferences/org.jenkins-ci ajp13Port 9990

Ingo said...

Hey Steve,

Good to hear that the issue was resolved that 'easy'. Currently there is no better way for feedback, when something went wrong during the start-up. I hope you didn't spent too much time.

Ted Husted said...

Could you post the uninstall script, please.

I'm getting a 4040 on port 8080, and I'd just like to run this out of the box instead.

Even if I try to use Jenkins on different HTTP or ajp13 ports, it won't load, and so now I'm locked out of Jenkins completely on this machine.

Ingo Richter said...

Hi Ted,

I'm sorry to hear that you had trouble getting everything to work properly.
First of all, you will find the uninstall script here
I use this script, when I test the installer. Do a "sudo ./" and the script removes everything except the jenkins folder in /Users/Shared/Jenkins.

I have a one questions regarding your changes:
After you changed the ajp13 port in the preferences, did you restart jenkins? I know this seems like a dumb question, but I always do a "kill -9 pid" to ensure my new settings get picked up. I had some trouble with the proper launchctl stop/start sequence.

I hope that helps to resolve your issues,

Ted Husted said...

Thank, Ingo, that worked.

I don't actually want to run Jenkins as a service on this machine, and so I will just use the command line for now.


fritz the cat said...

Hi, thanks for the installer.

In the damon documentation you link to it says "When you install your daemon, make sure that you set the file system permissions correctly. Apple recommends that daemons be owned by root, have an owning group of wheel... " etc. Yet the workspace is owned by damon:daemon

I manualy have to change permission / owner every time I create a new job in order to put build.xml or other files into them. If I want a Jenkins job to use Ant to copy file to a dir, then I have to change that permission of that dir to 777 to make it work as user daamon is no in group staff.

This is not ideal. Any chance you could implement saner permissions? Thanks

Ingo Richter said...

Hello fritz_the_cat,

What version of OSX are you using the installer on? I'm curious since you are the first one who reports this "misbehavior".
I'm currently on vacation with my family, but when I'm back I'd like to look into the issue and see if I can resolve this issue.

- Ingo

fritz the cat said...

thanks, no hurry, I have manually changed the group Jenkins runs under to 'staff' in the config file

I am on snow leopard

fritz the cat said...
This comment has been removed by the author.
fritz the cat said...

Actually, having problems with keys and permissions trying to manually calling svn+ssh. I have posted a question on stack overflow about it, if anybody out there knows the answer that would be great, thanks