Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a question on the use of nohup in an ssh session. During more than three years my java software executed the following command daily using a remote ssh session:

cd some_path; chmod 777 script.sh; ./script.sh

the content of script is:

nohup java java_command parameters &

It's simple and working perfectly all the time in red hat machines.

In a new software installation using the same environment the command is not working. It is also not working if I execute it manually from any remote ssh session. However, if I change the content of script.sh, removing the nohup and &, then the command works properly.

What can be the problem? The ssh settings are the same. The only difference that I found is that umask is 0012 in the new installation and in the original installation it was 0022.

Additional info: The original installation is a RHEL 5.4 and the new installation is a RHEL 6.3. Is the 6.3 version more restrictive by default?

share|improve this question
Do you get any error messages? – terdon Jun 10 '13 at 17:37
Is nohup available on the new system? Everyone allowed to execute it? – Hauke Laging Jun 10 '13 at 17:54
Probably not relevant to your problem, but you do not want mode 777. That allows write permission to everyone, which is exceptionally dangerous for something you're about to execute. You probably want 700. – derobert Jun 10 '13 at 20:49

Has your login shell changed?

Give this a try. Edit your script and change nohup to /usr/bin/nohup.

The reason it might be the solution is that login shells, such as the C shell, have their own version of "nohup". The C shell (or tcsh) nohup accepts a command but not a command argument. On the otherhand, /usr/bin/nohup can take a COMMAND and an optional command argument which is the way that you are using nohup.

share|improve this answer
Thanks ZaSter! I'll try it shortly and I will comment you the results. – Jose D. Jurado Jun 11 '13 at 8:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.