diff --git a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java index 68cc28705c66e7af100c2e0d0c202d57f5acfca0..11f364e953ba25fce29da0a4499aa567731cb219 100644 --- a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java +++ b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java @@ -132,7 +132,8 @@ public class WindowsServiceLifecycle extends Lifecycle { 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());