Skip to content

Commit

Permalink
[FIXED JENKINS-11742] don't change PID when a daemon is restarting
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed Nov 15, 2011
1 parent 0082ef8 commit f3566d1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
If running as a daemon, don't daemonize one more time during restart.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11742">issue 11742</a>)
<li class=bug>
Fixed NPE in Subversion polling of Maven jobs.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11592">issue 11592</a>)
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/hudson/lifecycle/UnixLifecycle.java
Expand Up @@ -52,6 +52,9 @@ public class UnixLifecycle extends Lifecycle {
public UnixLifecycle() throws IOException {
try {
args = JavaVMArguments.current();

// if we are running as daemon, don't fork into background one more time during restart
args.remove("--daemon");
} catch (UnsupportedOperationException e) {
// can't restart
failedToObtainArgs = e;
Expand Down

0 comments on commit f3566d1

Please sign in to comment.