配置Jenkins Mac OS X本机程序包以在其他端口中运行

时间:2011-09-19 17:26:33

标签: jenkins

Jenkins原生Mac OS软件包默认安装在/Users/Shared/Jenkins/Applications/Jenkins的战争中。它作为守护程序运行,并在尽管有kill -9命令的情况下自动重启。

我在winstone.properties中添加了一个/Applications/Jenkins,其中包含一个道具httpPort=9999

仍然应用程序从8080开始。

我甚至安装了CLI并试过:

    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)

简而言之,我无法强制停止/启动Jenkins和/或配置(我可以通过手动程序,虽然使用了战争)。

连连呢? 知道如何配置Jenkins

3 个答案:

答案 0 :(得分:22)

尝试:

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

要检查它是否有效:

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

然后杀死Jenkins进程并让它重新启动。

答案 1 :(得分:9)

您想使用launchctl来启动和停止Jenkins。来自luscarpa.com: Start & Stop Jenkins daemon on Mac OS X的示例:

启动詹金斯:

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

停止詹金斯:

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

答案 2 :(得分:3)

对于那些查杀过程的新手(就像我一样):

$ 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