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
(cherry picked from commit f3566d1)

Conflicts:

	changelog.html
  • Loading branch information
kohsuke authored and vjuranek committed Dec 14, 2011
1 parent 0ab36d3 commit 3bf2e4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelog.html
Expand Up @@ -58,6 +58,8 @@
<li class=bug>
Fixed the OutOfMemoryError in trying to download/install JDK
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-10689">issue 10689</a>)
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>)
</ul>
</div><!--=TRUNK-END=-->

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 3bf2e4f

Please sign in to comment.