ASM ASM - 1 month ago 6x
Java Question

How to get PID and Port # for a Jenkins Process

I need to get PID & Port# for a Jenkins process run. If i get that PID, i can kill the process if ever i need to.

I am running the Jenkins process by below commands:

java -jar jenkins.war

Sometimes, Jenkins Process fail to start if that port is taken and below occurs:

Jenkins home directory: /Users/MacPro/.jenkins found at: $user.home/.jenkins
Feb 27, 2016 10:46:09 AM org.eclipse.jetty.util.log.JavaUtilLog warn
Address already in use Address already in use

And I know how to run the jenkins process against a specific Port#.

Need to know the commands for which PID and the port, current job is using.


The command will be below:

ps -ef| grep jenkins 

It will display the process id.