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

    Clément BARRET



      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 2 Previous Next