-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NIFI-2199 & NIFI-3112 - Handle propagation of stderr and allow ssh restart #1786
Conversation
Thank you Aldrin, as a part of NIFI-2199 I was thinking about the solution of changing the RunNifi java app to close the relevant streams. Would be cleaner and as I already introduced problems with stream redirection using bash, i would go for changing the Java part. |
I tried this out, and it does appear to work when I run ssh user@remote-host "sudo service nifi restart". However, when I do the same with a salt command, it still hangs: I believe salt uses the python "subprocess" call to invoke a command this way. Since this was working in 1.1.x, I feel like there should be a way to get it working again in 1.2.x. Quick note: I changed 1>&- to 2>&- in order to also direct syserr to /dev/null, and this actually appears to work with salt. However, I don't know what adverse effects it may have. FWIW, I still saw the log statements in nifi-bootstrap.log during startup. |
Hey @gresockj, Don't have a lot of familiarity with python or Salt. Would you happen to have a sample salt script you would be able to share? I have a couple ideas on how to work with RunNiFi to make this happen. |
Salt is easy to set up with this walkthrough. You can run salt-master and salt-minion on the same nifi box if you want in order to reproduce this behavior. Once you have it installed, you can run the command: salt 'minionID' cmd.run "service nifi start" |
thanks, will see what I can find |
@apiri I'd be happy to help dig into the salt use case if you would like |
@kevdoran Sounds good! I propose we incorporate this PR for the time being to solve the prior two cases listed in the mentioned JIRAs and can open up a new JIRA to track issues with Salt and presumably other tools/scripts that may be Python driven. @gresockj let me know your thoughts. I will create a separate issue to track the Python side of the house. |
@apiri sounds good |
@apiri will review |
@apiri validated ssh command on remote host with with start/stop/restart. All worked as expected, with NiFi starting appropriately and the IO stream for ssh was closed. Also validated that bootstrap errors are appropriately routed to the output stream and displayed before stream is closed. +1 will merge shortly. Thanks Aldrin! |
…agate through. Signed-off-by: Yolanda M. Davis <ymdavis@apache.org> This closes apache#1786 (cherry picked from commit 58cf15a)
NIFI-2199
NIFI-3112
Pipe stdout to /dev/null and allow stderr to propagate through.
This correction does not make NiFi fully LSB spec compliant but does solve the two issues presented in the listed tickets. This will allow stderr to propagate through and restart through SSH.
ssh can be tested by issuing a
ssh user@remote-host <path to nifi>/bin/nifi.sh restart
from a local machine to a remote host
3112 can be verified by changing a property to bootstrap causing it to be invalid and running the above. As listed in the prior discussion of 3112, making
graceful.shutdown.seconds
a negative number such as below:Will cause an error to be triggered and the appropriate contents transmitted.