Github user bbende commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2746#discussion_r191555681
--- Diff: nifi-toolkit/nifi-toolkit-assembly/src/main/resources/bin/cli.sh
---
@@ -111,8 +111,7 @@ run() {
export NIFI_TOOLKIT_HOME="$NIFI_TOOLKIT_HOME"
umask 0077
- "${JAVA}" -cp "${CLASSPATH}" ${JAVA_OPTS:--Xms128m -Xmx256m}
org.apache.nifi.toolkit.cli.CLIMain "$@"
- return $?
+ exec "${JAVA}" -cp "${CLASSPATH}" ${JAVA_OPTS:--Xms128m -Xmx256m}
org.apache.nifi.toolkit.cli.CLIMain "$@"
--- End diff --
Does this have the same behavior in terms of the exit code that will be
returned from calling cli.sh?
I'm not familiar with exec, but it is import for the CLI that exit code
from the Java process is returned from calling cli.sh.
The man page for exec says:
"If there are no redirection errors, the return status is zero; otherwise
the return status is non-zero."
It is not clear to me if a redirection error is an error from the Java
process, or an error replacing the current shell with the Java process.
---