Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/700#discussion_r32864345
--- Diff:
core/src/main/java/brooklyn/util/internal/ssh/ShellAbstractTool.java ---
@@ -296,9 +296,10 @@ public ToolAbstractAsyncExecScript(Map<String,?>
props) {
* The executed command will return immediately, but the output
from the script
* will continue to be written
* note that some modes require \$RESULT passed in order to access
a variable, whereas most just need $ */
+ @Override
protected List<String> buildRunScriptCommand() {
String touchCmd = String.format("touch %s %s %s %s",
stdoutPath, stderrPath, exitStatusPath, pidPath);
- String cmd = String.format("( %s > %s 2> %s < /dev/null ; echo
$? > %s ) & disown", scriptPath, stdoutPath, stderrPath, exitStatusPath);
--- End diff --
Your change makes sense, I think. It was probably fine before, because
stdin is /dev/null and and stdout is the file.
As it says in [1], "if the terminal is destroyed..., the program will fail
as soon as it tries to read from standard input or write from standard output."
Other than that, it's very similar behaviour (from a user's perspective) to
`nohup ... &`.
@richardcloudsoft anything to add?
[1]
http://unix.stackexchange.com/questions/3886/difference-between-nohup-disown-and
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---