linuxjboss7.xio-redirectionnohup

linux nohup command with redirection


cannot figure out which is the correct way to start jboss EAP 6.1 in RedHat Linux.

nohup ./dev/jboss-eap-6.1/bin/standalone.sh 2>&1 < /dev/null &

or

nohup ./dev/jboss-eap-6.1/bin/standalone.sh 2>&1 > /dev/null &

To me the latter makes more sense, but I found the first one when I googled.

Additionally, is one of the above the correct way to start jboss in the server so that it does not quit when I log out? Or is there a better way (like, sudo something) ?

-SGB.


Solution

  • If you want to redirect both stdout and stderr to /dev/null, you can issue:

    nohup ./dev/jboss-eap-6.1/bin/standalone.sh > /dev/null 2>&1 &
    

    You probably want to read about I/O Redirection as well.