How to stop Jenkins installed on Mac Snow Leopard?

Viewed 72217

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.

9 Answers
  • Start Jenkins service: brew services start jenkins-lts
  • Stop Jenkins service: brew services stop jenkins-lts
  • Restart Jenkins service: brew services restart jenkins-lts

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

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

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

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

  3. brew services stop jenkins --all

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
Related