Permalink
Browse files

Merge pull request #1238 from gmjck/master

[FIX JENKINS-22685] Jenkins cannot restart Windows service
  • Loading branch information...
daniel-beck committed May 23, 2014
2 parents bef077b + c667110 commit f434c22f58ca156af314f806a39e58ffa619dc1d
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java
@@ -132,7 +132,8 @@ public void restart() throws IOException, InterruptedException {
else executable = new File(home, "hudson.exe");
if (!executable.exists()) executable = new File(home, "jenkins.exe");
int r = new LocalLauncher(task).launch().cmds(executable, "restart")
// use restart! to run hudson/jenkins.exe restart in a separate process, so it doesn't kill itself
int r = new LocalLauncher(task).launch().cmds(executable, "restart!")
.stdout(task).pwd(home).join();
if(r!=0)
throw new IOException(baos.toString());

0 comments on commit f434c22

Please sign in to comment.