Skip to content

Commit

Permalink
Merge pull request #1238 from gmjck/master
Browse files Browse the repository at this point in the history
[FIX JENKINS-22685] Jenkins cannot restart Windows service
  • Loading branch information
daniel-beck committed May 23, 2014
2 parents bef077b + c667110 commit f434c22
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -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());
Expand Down

0 comments on commit f434c22

Please sign in to comment.