ASF GitHub Bot commented on NIFI-1069:

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

    --- Diff: 
nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java ---
    @@ -581,30 +585,31 @@ private Status getStatus(final Logger logger) {
             return new Status(port, pid, pingSuccess, alive);
    -    public void status() throws IOException {
    +    public int status() throws IOException {
             final Logger logger = cmdLogger;
             final Status status = getStatus(logger);
             if (status.isRespondingToPing()) {
                 logger.info("Apache NiFi is currently running, listening to 
Bootstrap on port {}, PID={}",
                         new Object[]{status.getPort(), status.getPid() == null 
? "unknown" : status.getPid()});
    -            return;
    +            return 0;
             if (status.isProcessRunning()) {
                 logger.info("Apache NiFi is running at PID {} but is not 
responding to ping requests", status.getPid());
    -            return;
    +            return 0;
    --- End diff --
    @michalklempa It could be said the kernel PID refers to the JVM and not to 
the enclosed program. In this case, a rather return 4 as this stage, as the 
system is not in a healthy state and a certain status cannot be derived.

> Nifi Service Status return 0 when service not running
> -----------------------------------------------------
>                 Key: NIFI-1069
>                 URL: https://issues.apache.org/jira/browse/NIFI-1069
>             Project: Apache NiFi
>          Issue Type: Bug
>          Components: Core Framework
>    Affects Versions: 0.3.0
>         Environment: CentOS 6.7
>            Reporter: Andy Kruth
>            Priority: Minor
> After successfully installing Nifi as a service with the following command:
> sudo /opt/nifi-0.3.0/bin/nifi.sh install
> running service nifi status has a return code of 0.
> According to 
> http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
>  if the service is not running then status should return 3.
> This is not a major issue, you can still start and stop the service just 
> fine, but when using an idempotent tool like Ansible you cannot start the 
> service because the return code of status says the service is already started.

This message was sent by Atlassian JIRA

Reply via email to