Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure Jenkins Mac OS X native package to run in a different port

Tags:

jenkins

Jenkins native Mac OS package installs by default in /Users/Shared/Jenkins and the war in /Applications/Jenkins. It runs as a daemon and restarts automatically in spite of a kill -9 command.

I added a winstone.properties in /Applications/Jenkins with a single prop, httpPort=9999.

Still app starts on 8080.

I even installed CLI and tried:

    java -jar jenkins-cli.jar -s http://127.0.0.1:8080/ shutdown

Failed to authenticate with your SSH keys. Proceeding with anonymous access
Sep 19, 2011 1:11:00 PM hudson.remoting.Channel$ReaderThread run
SEVERE: I/O error in channel CLI connection to http://127.0.0.1:8080/
java.io.IOException: Unexpected termination of the channel
    at hudson.remoting.Channel$ReaderThread.run(Channel.java:1093)
Caused by: java.io.EOFException
    at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2553)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1296)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    at hudson.remoting.Channel$ReaderThread.run(Channel.java:1087)
Exception in thread "main" hudson.remoting.RequestAbortedException: hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected termination of the 
channel
    at hudson.remoting.Request.call(Request.java:149)
    at hudson.remoting.Channel.call(Channel.java:681)
    at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:158)
    at $Proxy2.main(Unknown Source)
    at hudson.cli.CLI.execute(CLI.java:171)
    at hudson.cli.CLI._main(CLI.java:297)
    at hudson.cli.CLI.main(CLI.java:216)
Caused by: hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected termination of the channel
    at hudson.remoting.Request.abort(Request.java:273)
    at hudson.remoting.Channel.terminate(Channel.java:732)
    at hudson.remoting.Channel$ReaderThread.run(Channel.java:1117)
Caused by: java.io.IOException: Unexpected termination of the channel
    at hudson.remoting.Channel$ReaderThread.run(Channel.java:1093)
Caused by: java.io.EOFException
    at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2553)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1296)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
    at hudson.remoting.Channel$ReaderThread.run(Channel.java:1087)

In short, I can't force stop/start Jenkins and/or configure (I can via manual procedure, using a war though).

Suggestions? Any idea how to configure the Jenkins

like image 704
pri Avatar asked Sep 19 '11 17:09

pri


People also ask

How do I run a Jenkins in another port?

Change Port for Jenkins in WindowsOpen the file using a text editor such as Notepad or Notepad++. Scroll down until you find the line that contains --httpPort=8080 and change the number to the port you want to set. Note: If you are using HTTPS with Jenkins, use java -jar jenkins.


3 Answers

Try:

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

To check that it has worked use:

defaults read /Library/Preferences/org.jenkins-ci

Then kill the Jenkins process and let it restart.

like image 176
andrew Avatar answered Nov 04 '22 21:11

andrew


You want to use launchctl to start and stop Jenkins. From the example at luscarpa.com: Start & Stop Jenkins daemon on Mac OS X:

Start Jenkins:

sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist

Stop Jenkins:

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
like image 22
Brad Knowles Avatar answered Nov 04 '22 21:11

Brad Knowles


For those new to killing processes (like I am):

$ ps -e | grep jenkins
   53 ??         0:02.51 /usr/bin/java -jar /Applications/Jenkins/jenkins.war
  392 ttys000    0:00.00 grep jenkins

$ sudo kill 53
like image 3
Željko Filipin Avatar answered Nov 04 '22 22:11

Željko Filipin