[
https://issues.apache.org/jira/browse/NIFI-14458?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17942302#comment-17942302
]
David Handermann commented on NIFI-14458:
-----------------------------------------
Thanks describing some of the background [~philci52].
The nifi.sh script for Linux and macOS has a {{run}} command that starts NiFi
in the foreground. The {{run}} command calls the NiFI bootstrap class to
generate the full Java command that should be executed, so there is some
coordination between the script of the Java class required for this to work.
This approach could also be implemented in nifi.cmd for the {{run}} command.
Before going in that direction, however, it is helpful that you mentioned
ProcRun.
There have been a few recent threads on the developers mailing list regarding
ProcRun in connection with changes to the bootstrap process for NiFi 2. If that
is the end goal, then attempting to build integration around the nifi.cmd
script may need some additional consideration. The primary purpose of the
nifi-bootstrap module is to read bootstrap.conf, structure the appropriate Java
command, and potentially monitor the NiFi application process. The monitoring
aspect may not be desirable from a service perspective as it requires two Java
processes.
With that background, it sounds like there is value either way in implementing
{{run}} for nifi.cmd analogous to how it works in nifi.sh, but there may be
additional work required for an optimal integration with ProcRun.
> Cannot use nifi.cmd to start nifi process in the foreground
> -----------------------------------------------------------
>
> Key: NIFI-14458
> URL: https://issues.apache.org/jira/browse/NIFI-14458
> Project: Apache NiFi
> Issue Type: Improvement
> Components: Core Framework
> Affects Versions: 2.3.0
> Environment: Windows 10, java 21
> Reporter: Phil Dicke
> Priority: Minor
>
> The current nifi.cmd script, cannot be used to start nifi in the foreground.
> The script checks for the "start" command and launches the process in the
> background.
> While this is convenient for using a typical shell user, it does not work for
> integrating the Apache ProcRun (
> [https://commons.apache.org/proper/commons-daemon/procrun.html] ) and running
> the application as a Windows Service using exe mode.
> Obviously, I can just copy and edit nifi.cmd to start the processes in the
> foreground, but I would prefer a more elegant solution.
> I'm proposing that I add a new command "startfg" to the nifi.cmd that will
> start the nifi process in the foreground. I'd like to get some feedback
> before I implement this. Is there a better option?
> [~exceptionfactory]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)