You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2022/02/02 22:36:17 UTC

[GitHub] [nifi] rmarturano opened a new pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

rmarturano opened a new pull request #4079:
URL: https://github.com/apache/nifi/pull/4079


   Thank you for submitting a contribution to Apache NiFi.
   
   Please provide a short description of the PR here:
   
   #### Description of PR
   
   After invoking nifi.sh install, systemd manager configuration is reloaded. In this way, wrapper from init.d to systemd service is generated and the service will work smoothly. Fixes bug NIFI-7192.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [x] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically `master`)?
   
   - [x] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
   
   ### For code changes:
   - [x] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
   - [ ] Have you written or updated unit tests to verify your changes?
   - [x] Have you verified that the full build is successful on both JDK 8 and JDK 11?
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
   - [ ] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`?
   - [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
   - [ ] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] jfrazee commented on pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
jfrazee commented on pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#issuecomment-1045049299


   @MikeThomsen Was just trying to snag some time to test on something besides Ubuntu. I validated it on Ubuntu 20.04 and OpenSuSE 15.3. This fix works as expected for both.
   
   There was a wrinkle with OpenSuSE -- they removed the rc*.d dirs entirely now so need to open another issue for that. This doesn't have anything to do with this PR though so merged.
   
   Thanks @rmarturano 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] MikeThomsen commented on pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
MikeThomsen commented on pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#issuecomment-1044482037


   @jfrazee why did you hold off on merge after approving? Was more work required?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] jfrazee commented on issue #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
jfrazee commented on issue #4079:
URL: https://github.com/apache/nifi/pull/4079#issuecomment-618530070


   @rmarturano For due diligence, what distributions has this been tested against? I have two worries with this: (1) that the commands might not always be on the path and (2) that using pidof might not be reliable.
   
   I think it might be worthwhile to add some additional checks (e.g., what's mentioned by https://www.freedesktop.org/software/systemd/man/sd_booted.html).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] jfrazee closed pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
jfrazee closed pull request #4079:
URL: https://github.com/apache/nifi/pull/4079


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] github-actions[bot] closed pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #4079:
URL: https://github.com/apache/nifi/pull/4079


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#discussion_r576382210



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
##########
@@ -245,6 +245,11 @@ SERVICEDESCRIPTOR
         ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
         echo "Service ${SVC_NAME} installed"
     fi
+
+    # systemd: generate nifi.service from init.d
+    if [ "$(pidof systemd)" ]; then

Review comment:
       As one additional alternative, since the conditional runs the `systemctl` command, what about checking for the command itself?
   ```suggestion
       if [ "$(which systemctl)" ]; then
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#discussion_r576395796



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
##########
@@ -245,6 +245,11 @@ SERVICEDESCRIPTOR
         ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
         echo "Service ${SVC_NAME} installed"
     fi
+
+    # systemd: generate nifi.service from init.d
+    if [ "$(pidof systemd)" ]; then

Review comment:
       Thanks for the feedback @rmarturano!  The link from @jfrazee in an earlier comment is a helpful reference point for his recommendation, so I will defer to the approach that both of you think is best under the circumstances.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] rmarturano commented on a change in pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
rmarturano commented on a change in pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#discussion_r576391843



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
##########
@@ -245,6 +245,11 @@ SERVICEDESCRIPTOR
         ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
         echo "Service ${SVC_NAME} installed"
     fi
+
+    # systemd: generate nifi.service from init.d
+    if [ "$(pidof systemd)" ]; then

Review comment:
       Can I apply those changes and update the PR?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] jfrazee commented on a change in pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
jfrazee commented on a change in pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#discussion_r576384160



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
##########
@@ -245,6 +245,11 @@ SERVICEDESCRIPTOR
         ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
         echo "Service ${SVC_NAME} installed"
     fi
+
+    # systemd: generate nifi.service from init.d
+    if [ "$(pidof systemd)" ]; then

Review comment:
       So, there's this unlikely/weird scenario where some of the systemd components could be installed but systemd isn't actually the init. Should we care about that? I dunno.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] rmarturano commented on a change in pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
rmarturano commented on a change in pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#discussion_r576391664



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
##########
@@ -245,6 +245,11 @@ SERVICEDESCRIPTOR
         ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
         echo "Service ${SVC_NAME} installed"
     fi
+
+    # systemd: generate nifi.service from init.d
+    if [ "$(pidof systemd)" ]; then

Review comment:
       I believe it's important to check if systemd is currently running.
   I'd opt for changes suggested by @jfrazee, even though @exceptionfactory option could already cover most of the cases.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] jfrazee commented on a change in pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
jfrazee commented on a change in pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#discussion_r576372149



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
##########
@@ -245,6 +245,11 @@ SERVICEDESCRIPTOR
         ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
         echo "Service ${SVC_NAME} installed"
     fi
+
+    # systemd: generate nifi.service from init.d
+    if [ "$(pidof systemd)" ]; then

Review comment:
       ```suggestion
       if [ -d "/run/systemd/system/" ] || [ ! -z "$(pidof systemd 2>/dev/null)" ]; then
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] rmarturano commented on pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
rmarturano commented on pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#issuecomment-1029065774


   @jfrazee Shall we merge it?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] rmarturano commented on pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
rmarturano commented on pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#issuecomment-779710709


   @jfrazee @exceptionfactory first of all thanks for your inputs.
   I applied suggested changes and rebased.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [nifi] exceptionfactory commented on a change in pull request #4079: NIFI-7192 - nifi.sh install not working on systemd servers

Posted by GitBox <gi...@apache.org>.
exceptionfactory commented on a change in pull request #4079:
URL: https://github.com/apache/nifi/pull/4079#discussion_r576387004



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-resources/src/main/resources/bin/nifi.sh
##########
@@ -245,6 +245,11 @@ SERVICEDESCRIPTOR
         ln -s "/etc/init.d/${SVC_NAME}" "/etc/rc2.d/K65${SVC_NAME}" || { echo "Could not create link /etc/rc2.d/K65${SVC_NAME}"; exit 1; }
         echo "Service ${SVC_NAME} installed"
     fi
+
+    # systemd: generate nifi.service from init.d
+    if [ "$(pidof systemd)" ]; then

Review comment:
       That's a good question.  It would be helpful to know how likely that scenario is to occur, but if systemd is not being used for initialization, then running `systemctl daemon-reload` shouldn't have an impact on the initialization configuration.  Ultimately, it would be better to handle service installation for systemd using an actual service configuration as opposed to relying on backward compatibility, but as it stands, this update seems like a good step forward.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org