From 2ea3d8f129453de4a0851f6c65571faada07b374 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Tue, 4 Mar 2014 10:17:23 -0800 Subject: [PATCH] if available, use the path variable exposed from winsw. See https://github.com/kohsuke/winsw/commit/2ffdbde6a92cf582baa4137e7b4de1116a3ca88b --- .../main/java/hudson/lifecycle/WindowsServiceLifecycle.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java index 6a8b4bec8d..87e00266a5 100644 --- a/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java +++ b/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java @@ -123,7 +123,10 @@ public class WindowsServiceLifecycle extends Lifecycle { ByteArrayOutputStream baos = new ByteArrayOutputStream(); StreamTaskListener task = new StreamTaskListener(baos); task.getLogger().println("Restarting a service"); - File executable = new File(home, "hudson.exe"); + String exe = System.getenv("WINSW_EXECUTABLE"); + File executable; + if (exe!=null) executable = new File(exe); + 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") -- GitLab