Operating System - HP-UX
1826466 Members
2357 Online
109692 Solutions
New Discussion

Re: nohup command from sudo

 
Chris Burton_3
New Member

nohup command from sudo

We have a script that we run from sudo that checks environment variables, and then we can run one of several jobs. The jobs are submitted using:
nohup cmd >> log 2>&1 &
This should put the command in the background and log to the log file. The original script (sudo run_script) never releases the nohup command. You can do ps and see the parent/child process ids, and it just sits there. We can ctrl-z & bg to push both processes into the background. Is there a limitation about running nohup jobs from sudo. I have tried nohup cmd & >> log 2>&1, but this sends the output to nohup.out, and not the log file. The original way also sends output to nohup.out.
1 REPLY 1
Angus Crome
Honored Contributor

Re: nohup command from sudo

Try enclosing the entire line in grave quotes `` such as;

`nohup cmd >> log 2>&1 &`

Grave quotes are the backward quote next to the 1 key.
There are 10 types of people in the world, those who understand binary and those who don't - Author Unknown