1 2 Previous Next 16 Replies Latest reply on Dec 21, 2015 9:05 AM by Yanick Girouard

    NSH nohup builtin is not properly implemented / not working at all

    Clement BARRET

      Hi,

       

      during my NSH scripts development, I found out a very annoying issue regarding NSH implementation of the common nohup builtin.

       

      To proof my claim, just create a simple nsh script (or any other shell script, or anything, it will do the same if you start any command actually) that you want to monitor and log to for example /tmp/my_test_output.log

       

      So, open a new terminal window (like a PuTTY in my case).

       

      Be sure to use the NSH shell, or start it if that's not the case. Just type nsh.

       

      Start your command/script like this :

       

      nohup /path/to/my/command 1>/tmp/my_test_output.log 2>&1 &

       

      now, your script/command runs in the background, it should be detached from the terminal and keep running even if you close your PuTTY window. So, do it. Close your PuTTY/terminal window.

       

      Re-open it (or use another terminal on the same computer) and check if your script/process is still running.

       

      Well, it's not.

       

      To make this obvious, open two terminals, once you're started your script/command in the backgroun on the first terminal, open a tail -f /tmp/my_test_output.log in your other terminal.

       

      Close the first terminal, you'll see that there will be no more output comming to your log file...

       

      So, basically : NSH is NOT WORKING since nohup is a REALLY IMPORTANT builtin in UNIX/LINUX !

       

      And you can do the same test using any regular shell like bash or ksh and you'll see that your nohup'ed script/command will still be running after closing your terminal ! (as it is supposed to...)

       

      Another flaw of BMC's perfect closed source policy...

       

      Take good open source products (granted they use a non restrictive open licence, aka NOT GPL) products -- ie zsh which is almost flawless imho -- and add a ton of closed source crap code inside and sell this to your tied customers... They'll eat it even if it's not working... they'll eat more every time you're upgrading your crap !

       

      I think this should stop, we can't afford to work with such unreliable software anymore, it's making my work a real nightmare...

       

      Please FIX this.

       

      Our BladeLogic platform runs a 8.3 SP2 version.

       

      The fun part is that line :

       

      % nsh --version

      zsh 4.3.4 (i686-pc-linux-gnu)

       

      They couldn't even implement their own --version command line option...

       

       

      So, I'll ask again : PLEASE FIX THIS.

       

      ---

      As attachment, I'll join two simple scripts which you could use to test my claims.

       

      A "father" script and a child one.

       

      You can close your terminal as soon as the father script is done.

       

      just start ./father_script in the shell directory you want to test the nohup behaviour.

       

      Notice that the zsh behaviour is obviously the same as the nsh one since it's in fact the same binary...

        • 1. Re: NSH nohup builtin is not properly implemented / not working at all
          Bill Robinson

          That seems to be a valid defect.  I suggest opening up a support ticket on this so we can address it.

          • 2. Re: NSH nohup builtin is not properly implemented / not working at all
            Jim Wilson

            Hi @Clément BARRET

             

            BMC are happy to work with you about any issue or concerns that you may have, but I really see no need for any flaming.

             

            We generally have a really good level of decorum on this forum, an dit would be really nice to keep it that way.

             

            Thanks for your understanding.

            Jim

            • 3. Re: NSH nohup builtin is not properly implemented / not working at all
              Clement BARRET

              Bill Robinson : Thanks, I've opened a support ticket ( issue has been submitted and the issue ID is ISS04375112 )


              Jim Wilson : Well, sorry but I'm shocked when I discover the BladeLogic core (NSH) of "your" work is not reliable... I mean, how comes you've never noticed this issue ? Am I the only one working with NSH here ? I don't think so...

               

              And I'm about to open another huge anomaly ticket when NSH can silently SEGFAULT ! I mean, we're talking about a SHELL right ? How should that be possible ?? This one is trickier to make obvious and easily reproductble so I have to find the way you'll be able to reproduce it... but I garantee you this is happening, and it's making me very miserable at work...

               

              One can't develop reliable stuff basing one's work on unreliable ones...

               

              Put more time and money on quality assurance and less in community forums moderation... because there would be no need to moderate angry customers when there was no reason for them to be angry in the first place ! Obvious isn't it ?

               

              Regards

              • 4. Re: NSH nohup builtin is not properly implemented / not working at all
                Bill Robinson

                Clement - there are defects and issues in any software product - open source and closed source alike.  How long were HeartBleed and Shellshock present in code that is open for all to review before they were discovered ?  That is not a knock against open source, it's just a reality of software written by humans.

                 

                If there is some problem in the software, we will investigate it and work to resolve it.  It's difficult to say why NSH might segfault or any other issue you bring up would happen without knowing the conditions under which it happens or having any context.

                 

                The best place to get a resolution on these types of issues is via support and not complaining about it on the community.  If there is some issue w/ support responsiveness, we can have that discussion, but I don't think that it's appropriate to start shaming on the community before you've even engaged support and made us aware of an issue.  NSH works w/o issue for many customers, so to say nsh is not working because of an issue w/ a single command out of hundreds is a bit unfair.  I would not call zsh 'flawless': http://sourceforge.net/p/zsh/bugs/ - every software has its issues.

                1 of 1 people found this helpful
                • 5. Re: NSH nohup builtin is not properly implemented / not working at all
                  Jim Wilson

                  Hi Clement,

                   

                  I sympathise, but let me ask you this.  Do all of your programs and scripts work perfectly, with never a change?

                   

                  If so, you may be entitled to use the word crap, or to be sarcastic in your comments, but otherwise, it's best to maintain decorum and let us work together to achieve the common goal of solving the problems without the pejoratives.

                   

                  Thanks & Regards,

                  Jim

                   

                  P.S. The support issue has been escalated to the engineering team with your otherwise excellent description of the problem and the supporting material.

                  • 6. Re: NSH nohup builtin is not properly implemented / not working at all
                    Joe Piotrowski

                    I think I found the problem.

                     

                    "It was the salmon mousse..."

                    salmon.jpg

                    Engineering is verifying and I'll keep you posted.

                    • 7. Re: NSH nohup builtin is not properly implemented / not working at all
                      Clement BARRET

                      Bill Robinson :

                       

                      Well, please don't go on that road...You're mentioning two security vulnerability issues that weren't exploited in the real world and patched on a theorical base (for our own good). This is not the same at all as re-using some working and existing code to make it unusable. Plus, you're talking about "undred of commands" when there are like less than two dozen regular builtins in a Unix shell... and nohup must be one of the most used ones in the real world... Don't forget "your" NSH is just a ZSH on which your team has plugged some of their NSH agent stuff so this shoudln't even be impacted by "your" own modifications... That's not as if BMC (or the company BMC bought) had rewritten a shell (at all)...

                       

                      Then, you throw me a zsh bug report... I said "almost flawless" (not "flawless") and you're throwing me the bug tracker of the zsh development team ? Well, don't "you" base your own code on zsh to build NSH ? So, have you already fixed all of these bugs or are you willing to "steal" the patches once they've been done by open source contributors ? So, while we're talking, NSH users will still be plagged by those bugs... Nice !

                       

                      I guess, as I said, I won't mention my other issue up until I got enough material to make it obvious and reproductble, because that's what I do.

                       

                      Jim Wilson :

                       

                      Don't you dare patronize me when I'm just an IT engineer and you're a member of a big corporation earning millions selling your products ! (Notice that I prevented myself to add the "crap" qualifier there ! As you see, I'm making some efforts to communicate with you nicely...). You have the tools, people and money enough to prevent this kind of lack of quality assurance in the releases of the products you sell to your customers... When I deliver something, it will always have been tested, patched, re-tested, re-patched and so on as long as it's not fulfilling our quality requirements in our QA lab environment. I can garantee you that when it's going into production, it's been thoroughly tested and even if some minor unforeseen minor issue could still occur, it wouldn't be a trivial one at all...

                       

                      Anyway, I agree with you there's no need to flame more here, and my point is clear on that subject.

                       

                      Thanks for having escalated the issue to your IT engineering team.

                       

                      Regards,

                      • 8. Re: NSH nohup builtin is not properly implemented / not working at all
                        Don Kim

                        Joe, you are slipping. You need the reference for the younglings:

                         

                        the salmon mousse - YouTube

                        1 of 1 people found this helpful
                        • 9. Re: NSH nohup builtin is not properly implemented / not working at all
                          Marcel Bucher

                          Hi all

                           

                          I had a similar (or same) issue with BL 8.2.04. Processes which were started with nohup stopped after NSH job exited.

                          I put a 'sleep 10' after nohup which solved for me mostly, unfortunately not always. I have seen that in the attached test scripts there is also a sleep, which seems does not always help....

                           

                          regards

                          Marcel

                          • 10. Re: NSH nohup builtin is not properly implemented / not working at all
                            Yanick Girouard

                            This is still an issue in 8.7. I have tested like so on Windows 2008:

                             

                            # Open NSH

                            # Run: nohup sleep 900 &

                            # Open task manager and confirm sleep.exe is running

                            # Close the NSH shell

                            # Notice sleep.exe is killed

                             

                            Was a defect ever filed and was it supposed to be fixed?

                            • 11. Re: NSH nohup builtin is not properly implemented / not working at all
                              Bill Robinson

                              2008 , r2 ?

                               

                              on a win7 box it works fine for me:

                               

                              • 12. Re: NSH nohup builtin is not properly implemented / not working at all
                                Yanick Girouard

                                Don't type exit, try just closing the NSH Script shell with the X... I did try on Windows 7, and our app server in Windows 2008 R2.

                                • 13. Re: NSH nohup builtin is not properly implemented / not working at all
                                  Bill Robinson

                                  That’s interesting – i see what you mean.  the same thing works fine in Linux – open a terminal window, run ‘nohup sleep 600 &’ and close the terminal window, sleep is still going.  so maybe something w/ the Cygwin layer.

                                   

                                  But is that really a problem?  if you are nexec’ing / nohuping it on a target does the sleep process get left running on the target system ?

                                  • 14. Re: NSH nohup builtin is not properly implemented / not working at all
                                    Yanick Girouard

                                    I know the exit command doesn't send the same signal as closing the window, so that could have to do with that...

                                    1 2 Previous Next