Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ private List<String> scriptLauncherCmd(ShellController c, FilePath ws, @CheckFor
cmdString = cmdString.replace("$", "$$"); // escape against EnvVars jobEnv in LocalLauncher.launch
List<String> cmd = new ArrayList<>();
if (os != OsType.DARWIN && os != OsType.WINDOWS) { // JENKINS-25848 JENKINS-33708
cmd.add("nohup");
// Some java implementation do block SIGPIPE signal by default, so make sure the default
// signal handler is used to avoid having commands hanging for ever.
// env --default-signal=SIGPIPE was introduced in coreutils 8.31 released in 2019,
// so cope with old OS not supporting this.
cmd.addAll(Arrays.asList("sh", "-c", "if env --default-signal=SIGPIPE true 1>/dev/null 2>&1; then exec env --default-signal=SIGPIPE \"$$@\"; else exec \"$$@\"; fi", "--", "nohup"));
}
if (LAUNCH_DIAGNOSTICS) {
cmd.addAll(Arrays.asList("sh", "-c", cmdString));
Expand Down