How to stop Jenkins installed on Mac Snow Leopard?
Asked Answered
P

9

94

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.

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

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.

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

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

Pachysandra answered 5/8, 2011 at 16:12 Comment(3)
Can you tell me which command you used to stop it. I used jettyserver/exit but seems it is not working.Sammons
Hey @JigneshSheth I used daniel's answerPachysandra
UI --> jenkins --> manage jenkins --> prepare for shutdown OR brew services stop jenkins --allPendant
P
218

Just unload the plist using launchctl

sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
Petcock answered 4/11, 2011 at 12:1 Comment(2)
If in case you want to again have your jenkins started.. just use the reverse of the above --- sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plistPachysandra
Works fine on 10.8.4, and I suspect it'll work forever with minor tweaks.Allgood
A
35

For 1.505 you can use web api

http://localhost:8080/exit
http://localhost:8080/restart
http://localhost:8080/reload
Aduwa answered 11/3, 2013 at 9:52 Comment(5)
I really needed a more direct way to kill Jenkins since I couldn't kill the process via the command line. Thanks!Ostracod
This really doesn't work. On OSX the jenkins server is immediately restarted by a daemon.Allgood
@EngineerDollery Maybe things have changedAduwa
Time report: Unfortunately it's still the same :(Iridosmine
Using this method, I'm getting the error: "This URL requires POST"Holley
T
15
  • Start Jenkins service: brew services start jenkins-lts
  • Stop Jenkins service: brew services stop jenkins-lts
  • Restart Jenkins service: brew services restart jenkins-lts
Tridentum answered 16/5, 2020 at 13:8 Comment(1)
Perfect. This has helped me! Thanks.Brenn
R
6

There are two things going on.

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

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

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

sudo launchctl unload /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

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

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

Radiochemistry answered 22/11, 2017 at 19:43 Comment(0)
E
3

I had to unload/load the LaunchAgents:

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

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

I'm on Sierra (10.12.3).

Elastance answered 8/3, 2017 at 8:49 Comment(0)
I
1

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.html you should do:

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

UPD: didn't work for me (

Imtiaz answered 1/9, 2015 at 12:48 Comment(0)
C
1

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

Cholecalciferol answered 5/11, 2018 at 12:11 Comment(0)
P
1
  1. sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist

  2. UI -> jenkins --> manage jenkins --> prepare for shutdown

  3. brew services stop jenkins --all

Pendant answered 2/7, 2020 at 7:57 Comment(0)
W
0

Jenkins commands for Mac for M1 and Intel

Start Jenkins service   : brew services start jenkins-lts
Stop Jenkins service    : brew services stop jenkins-lts
Restart Jenkins service : brew services restart jenkins-lts
Wicklow answered 12/7, 2021 at 17:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.