macos 如何阻止安装在 Mac Snow Leopard 上的 Jenkins?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6959327/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:17:21  来源:igfitidea点击:

How to stop Jenkins installed on Mac Snow Leopard?

macosjenkinsdaemon

提问by raksja

I have installed Jenkins executable on OSX, but now I want to stop it running. Whenever I kill it, no matter how, it just restarts immediately.

我已经在 OSX 上安装了 Jenkins 可执行文件,但现在我想停止它运行。每当我杀死它时,无论如何,它都会立即重新启动。

I've tried using the exit command on the jenkins url:

我试过在 jenkins url 上使用 exit 命令:

http://localhost:8080/exit

which asks me to post the command, which I do, and the server shuts down as requested. But then it restarts.

这要求我发布命令,我这样做了,然后服务器按要求关闭。但随后它重新启动。

I've tried searching for the process id using ps, and force killing it (kill -9 pid), and the server shuts down immediately, as requested. But then it restarts.

我已尝试使用 搜索进程 id ps,并强制终止它 ( kill -9 pid),服务器会根据要求立即关闭。但随后它重新启动。

I've tried shutting it down via the gui, but unfortunately there doesn't seem to be a way to do that.

我试过通过 gui 关闭它,但不幸的是似乎没有办法做到这一点。

There must be a daemon somewhere, making this a general OSX question.

某处必须有一个守护进程,这使得这是一个普遍的 OSX 问题。

回答by danielMitD

Just unload the plist using launchctl

只需使用launchctl卸载plist

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

回答by Nik

For 1.505 you can use web api

对于 1.505,您可以使用 web api

http://localhost:8080/exit
http://localhost:8080/restart
http://localhost:8080/reload

回答by JMS

There are two things going on.

有两件事正在发生。

(1) will your system start Jenkins when it comes up. Controlled by load and unload.

(1) 你的系统会在 Jenkins 出现时启动它吗?由装载和卸载控制。

(2) Is Jenkins currently running or not. Controlled by start and stop.

(2) Jenkins 当前是否正在运行。由启动和停止控制。

Jenkins unload stops it and it won't load again on boot up

詹金斯卸载停止它,它不会在启动时再次加载

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

须藤 launchctl 卸载 /Library/LaunchDaemons/org.jenkins-ci.plist

stop it without unloading it ( will load again when you reboot)

停止它而不卸载它(重新启动时会再次加载)

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

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

load it - starts it and will restart whenever your system boots

加载它 - 启动它并在系统启动时重新启动

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

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

restarts it, doesn't effect loaded or unloaded status

重新启动它,不影响加载或卸载状态

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

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

回答by Arie Laxed

I had to unload/load the LaunchAgents:

我不得不卸载/加载LaunchAgents

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

须藤 launchctl 卸载 /Library/LaunchAgents/org.jenkins-ci.plist

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

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

I'm on Sierra (10.12.3).

我在 Sierra (10.12.3) 上。

回答by Nakilon

Note, that if you wish also to disable running Jenkins on Mac OS start up, according to http://halyph.blogspot.ru/2013/03/jenkins-on-mac-os-x-tips-and-tricks.htmlyou should do:

请注意,根据http://halyph.blogspot.ru/2013/03/jenkins-on-mac-os-x-tips-and-tricks.html,如果您还希望在 Mac OS 启动时禁用运行 Jenkins你应该做:

sudo defaults write /Library/LaunchDaemons/org.jenkins-ci RunAtLoad -bool NO

sudo 默认写入 /Library/LaunchDaemons/org.jenkins-ci RunAtLoad -bool NO

UPD: didn't work for me (

UPD:对我不起作用(

回答by Avinash

use launchctl unload /Users/<user>/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

利用 launchctl unload /Users/<user>/Library/LaunchAgents/homebrew.mxcl.jenkins.plist

回答by Gat

  • Start Jenkins service: brew services start jenkins-lts
  • Stop Jenkins service: brew services stop jenkins-lts
  • Restart Jenkins service: brew services restart jenkins-lts
  • 启动詹金斯服务: brew services start jenkins-lts
  • 停止 Jenkins 服务: brew services stop jenkins-lts
  • 重启詹金斯服务: brew services restart jenkins-lts