0

I have a local instance of Jenkins running on port 8080 on my mac machine. I want to kill this process and have tried doing so, like below :

lsof -i tcp:8080
kill -9 <the pid>

This closes my chrome instance. But when I open Chrome again and go to localhost:8080, Jenkins is still running over there. Any ideas as to why these commands don't kill it? Also how to kill the process?

Thanks

Tamas Rev
  • 7,008
  • 5
  • 32
  • 49
Cassus
  • 199
  • 6
  • 14
  • Because you kill Chrome, not Jenkins. – tkausl Apr 11 '17 at 14:31
  • This. Jenkins running as a service? `service jenkins status` or `systemctl status jenkins` – Nick H. Apr 11 '17 at 14:33
  • I had the same problem. Every time I would kill the jenkins process, it would restart. The answer for me was here: https://apple.stackexchange.com/questions/272657/how-can-i-kill-the-jenkins-process – mojave Dec 25 '18 at 22:23

3 Answers3

3

Try using the below :

  1. Try to identify the Jenkins instance/process id , like something below:

    ps -ef| grep jenkins

  2. Go to the server (like apache) where your Jenkins is installed and kill the process id like below :

    $ kill -9 1001(processId)

dildeepak
  • 1,349
  • 2
  • 16
  • 34
1

lost -i tcp:8080 will also list processes that connect to port 8080, e.g. chrome. What happens if you repeat above commands after you've quit chrome? Then hopefully Jenkins should be the only process working on port 8080.

cello
  • 5,356
  • 3
  • 23
  • 28
1

If you installed Jenkins via the OSX Installer you'll need to follow these instructions to edit the plist file via the command line (manually doing it is a pain).

When you've made necessary changes, such as running

sudo defaults write /Library/Preferences/org.jenkins-ci httpPort [YOUR DESIRED PORT HERE]

you'll need to 'unload' Jenkins:

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

And now Jenkins is dead. To undead Jenkins just swap load for unload in the above command.

Jai
  • 2,768
  • 24
  • 20