1753954 Members
7303 Online
108811 Solutions
New Discussion юеВ

proccess in background

 
Fredy Correa
Advisor

proccess in background

good afternoon.. with which command can I execute a job so that when closing the session the process it is not canceled???
I am attempting with nohup, with & but it doesn't work.
Thank you
11 REPLIES 11
Rick Garland
Honored Contributor

Re: proccess in background

nohup &

Were you forgetting the Amperstand character at the end?

Kent Ostby
Honored Contributor

Re: proccess in background

Fredy:

nohup &

should work.

What command is it that you are trying to run?

"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Steven E. Protter
Exalted Contributor

Re: proccess in background

Shalom Fredy,

the nohup command tries to create a file called nohup.out in the current directory. Its possible if access rights don't permit this that its being blocked.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
A. Clay Stephenson
Acclaimed Contributor

Re: proccess in background

Bear in mind that nohup sets the default signal handling for the child process to ignore SIGHUP and SIGQUIT but the child process might introduce custom signal handlers which override this behavior thus not all processes are valid candidates for nohup.
If it ain't broke, I can fix that.
Ninad_1
Honored Contributor

Re: proccess in background

Fredy,

As everyone has mentioned what you wish to do works with nohup command & .
Why you are saying it doesnt run ?
When you give the command
nohup commmand &
the pid of the process is displayed. So
1. Check before exiting from the session if the process is running by
ps -ef | grep
2. Check the nohup.out file - to see if any errors had occured.

Hope this helps,

Ninad
Fredy Correa
Advisor

Re: proccess in background

When generating the command it tells me that the pid is XXX, when I see for ps - ef appears me that and other jobs that the one generates, when leaving the session it cancels them

Fredy
Fredy Correa
Advisor

Re: proccess in background

the nohup.out is this hole
Muthukumar_5
Honored Contributor

Re: proccess in background

Try like this:

-- script --
contains shell commands

# nohup ./script 1>/tmp/test.log 2>/tmp/test.err &

it will not cancel the process which created by script. Read man nohup in EXAMPLES part.

--
Muthu
Easy to suggest when don't know about the problem!
Senthil Prabu.S_1
Trusted Contributor

Re: proccess in background

Hi,

Use nohup to obtain it.

Syntax:
#nohup &


HTH,
Prabu.S

One man's "magic" is another man's engineering. "Supernatural" is a null word.