If you use the --daemon option then I am pretty sure that Jenkins will keep the same PID when restarted via the UI as it can relaunch the JVM without starting a new process (due to the fun of Unix fork() and the magic coder that is Kohsuke).
At least that is my setup (with embedded winstone) on Linux and I install plugins and set to restart when no jobs are running and I can still control it with service jenkins stop/status 'java -jar jenkins.war --help' will show you all the options. http://akuma.kohsuke.org/ /James On Monday, 2 September 2013 09:16:29 UTC+1, Christophe Demarey wrote: > > Hi all, > > I think I have a simple question for you but really important for me : How > to prevent Jenkins to change its PID after a Jenkins restart (ex: Jenkins > update or plugin update)? > I really need this behavior to have working daemon scripts because they > use the PID to know the status of the Jenkins process. If the Jenkins PID > changes, the script is lost. > > For information, here is the command the deamon use to run Jenkins: > /usr/bin/daemon --name=myjenkins --inherit > --env=JENKINS_HOME=/home/myjenkins --output=/var/log/ci/myjenkins.log > --pidfile=/var/run/jenkins/myjenkins.pid -- /usr/bin/java -jar > /home/myjenkins/jenkins.war --webroot=/home/myjenkins/.jenkins/war > --httpPort=17001 --ajp13Port=-1 --httpsPort=-1 --prefix=/myjenkins > > Thanks for any answer. > > Berst regards, > Christophe. -- You received this message because you are subscribed to the Google Groups "Jenkins Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
