[
https://issues.apache.org/jira/browse/NIFI-5247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16494169#comment-16494169
]
ASF GitHub Bot commented on NIFI-5247:
--------------------------------------
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.
> NiFi toolkit signal handling changes, Dockerfile enhancements
> -------------------------------------------------------------
>
> Key: NIFI-5247
> URL: https://issues.apache.org/jira/browse/NIFI-5247
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Docker, Tools and Build
> Affects Versions: 1.6.0, 1.7.0
> Reporter: Peter Wilcsinszky
> Priority: Minor
>
> 1. Signal handling issues
> In order for processes to handle signals properly in Docker we have to
> implement explicit signal handling for the first process in the container. In
> the case of the NiFi toolkit the easiest solution is to replace the bash
> shell with the Java process and let it handle the signal using the exec
> system call. More detailed explanation of the issue:
> [http://veithen.github.io/2014/11/16/sigterm-propagation.html]
> Relevant issues: NIFI-3505 and NIFI-2689 that already added exec to the run
> invocation of the nifi.sh start script.
> This changes makes stopping containers fast and graceful.
> 2. TLS toolkit commands and basic tooling in the container
> In order to be able to request certificates from a running CA server instance
> some tooling is needed inside the container. These tools are openssl for
> checking ssl certificates and endpoints, and jq for config.json processing. A
> complete use case is available in the following NiFi helm chart:
> [https://github.com/pepov/apache-nifi-helm/blob/master/templates/statefulset.yaml#L75]
>
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)