Github user alopresto commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/386#discussion_r62085710
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
 ---
    @@ -211,9 +211,9 @@ run() {
         # run 'start' in the background because the process will continue to 
run, monitoring NiFi.
         # all other commands will terminate quickly so want to just wait for 
them
         if [ "$1" = "start" ]; then
    -        (cd "${NIFI_HOME}" && ${sudo_cmd_prefix} "${JAVA}" -cp 
"${BOOTSTRAP_CLASSPATH}" -Xms12m -Xmx24m 
-Dorg.apache.nifi.bootstrap.config.file="${BOOTSTRAP_CONF}" 
org.apache.nifi.bootstrap.RunNiFi $@ &)
    +        (cd "${NIFI_HOME}" && ${sudo_cmd_prefix} "${JAVA}" -cp 
"${BOOTSTRAP_CLASSPATH}" -Xms12m -Xmx24m 
-Dorg.apache.nifi.bootstrap.config.log.dir="${NIFI_LOG_DIR}" 
-Dorg.apache.nifi.bootstrap.config.pid.dir="${NIFI_PID_DIR}" 
-Dorg.apache.nifi.bootstrap.config.file="${BOOTSTRAP_CONF}" 
org.apache.nifi.bootstrap.RunNiFi $@ &)
         else
    -        (cd "${NIFI_HOME}" && ${sudo_cmd_prefix} "${JAVA}" -cp 
"${BOOTSTRAP_CLASSPATH}" -Xms12m -Xmx24m 
-Dorg.apache.nifi.bootstrap.config.file="${BOOTSTRAP_CONF}" 
org.apache.nifi.bootstrap.RunNiFi $@)
    +        (cd "${NIFI_HOME}" && ${sudo_cmd_prefix} "${JAVA}" -cp 
"${BOOTSTRAP_CLASSPATH}" -Xms12m -Xmx24m 
-Dorg.apache.nifi.bootstrap.config.log.dir="${NIFI_LOG_DIR}" 
-Dorg.apache.nifi.bootstrap.config.pid.dir="${NIFI_PID_DIR}" 
-Dorg.apache.nifi.bootstrap.config.file="${BOOTSTRAP_CONF}" 
org.apache.nifi.bootstrap.RunNiFi $@)
         fi
    --- End diff --
    
    Since these two commands differ only by the trailing `&` to indicate a 
background process, can we store the long command in a variable once? This will 
reduce the effort to update in the future (forgetting to modify both lines). 
    
    Something like:
    
    ```
    RUN_CMD="cd \"${NIFI_HOME}\" && ${sudo_cmd_prefix} \"${JAVA}\" -cp 
\"${BOOTSTRAP_CLASSPATH}\" -Xms12m -Xmx24m 
-Dorg.apache.nifi.bootstrap.config.log.dir=\"${NIFI_LOG_DIR}\" 
-Dorg.apache.nifi.bootstrap.config.pid.dir=\"${NIFI_PID_DIR}\" 
-Dorg.apache.nifi.bootstrap.config.file=\"${BOOTSTRAP_CONF}\" 
org.apache.nifi.bootstrap.RunNiFi \"$@\""
    
    if [ "$1" = "start" ]; then
        ("$RUN_CMD" &)
    else
        ("$RUN_CMD")
    fi
    ```


---
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.
---

Reply via email to