[
https://issues.apache.org/jira/browse/NIFI-15520?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18054881#comment-18054881
]
David Handermann commented on NIFI-15520:
-----------------------------------------
Thanks for describing the change in behavior [~HennigD2].
NiFi 2 introduced a [significant refactor to the bootstrap
process|https://exceptionfactory.com/posts/2025/10/27/rebooting-bootstrap-for-apache-nifi-2/],
including the removal of PID file creation.
This was an intentional change in the design, and is not a bug from that
perspective.
The nifi.sh commands provide the same function as before, but without PID file
tracking.
Integration with service managers like {{systemd}} is outside of direct project
control, and the redesigned approach may have impact on historical approaches.
With that background, reintroducing the PID file is not a design target, and
should be avoided. However, supporting alternatives for identifying process
status is certainly open for consideration.
The impact section of this issue describes some possible use cases. It would be
helpful to identify more concrete examples, which would move in the direction
of considering alternatives.
> NiFi 2.x Ignores NIFI_PID_DIR and Does Not Create a PID File
> ------------------------------------------------------------
>
> Key: NIFI-15520
> URL: https://issues.apache.org/jira/browse/NIFI-15520
> Project: Apache NiFi
> Issue Type: Task
> Components: Configuration
> Affects Versions: 2.7.2
> Environment: Apache NiFi Version: 2.7.0 and 2.5.0
> Operating System: Oracle Linux Server 9.6
> Java Version: jdk-24.0.2-oracle-x64
> Node Role: cluster and standalone
> Reporter: Dirk Hennig
> Priority: Major
> Labels: pidfile
>
> h3. Description:
> Starting with NiFi 2.x, it appears that the application no longer creates a
> PID file, even when the {{NIFI_PID_DIR}} environment variable is correctly
> configured, and the designated location is writable. This behavior differs
> from earlier versions of NiFi (1.x series), where the PID file creation was
> consistent and reliable.
> This issue affects process management and deployment automation, as external
> tools and service managers rely on the PID file for monitoring and
> controlling the NiFi process. Several users have reported this issue in
> discussion forums and community threads, but it is not clear whether this is
> a deliberate change, a regression, or a bug.
> The pid file is not created with default value for NIFI_PID_DIR or when set
> fixed.
> h3. Steps to Reproduce:
> # Set the {{NIFI_PID_DIR}} variable in the NiFi startup scripts or via the
> environment.
> # Ensure the configured location is writable and has the necessary
> permissions.
> # Start NiFi using the usual commands (e.g., {{nifi.sh start}} or
> {{{}./bin/nifi start{}}}).
> # Check the specified {{NIFI_PID_DIR}} for the presence of the PID file.
> h3. Actual Result:
> No PID file is created in the {{{}NIFI_PID_DIR{}}}, despite the correct
> configuration and writable location.
> h3. Expected Result:
> A PID file is created in the configured {{{}NIFI_PID_DIR{}}}, as was the
> behavior in previous versions of NiFi (1.x). Example: $NIFI_HOME/run/nifi.pid
> h3. Impact:
> The absence of the PID file affects:
> * Process management and control for service monitoring tools.
> * Automation scripts relying on the PID file for detecting the NiFi instance.
> * Service managers like {{{}systemd{}}}, which may rely on the PID file for
> lifecycle management when not explicitly configured otherwise.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)