Usage of NOHUP - How to keep the child process running even if I close the Server connection

Hi. !

When I use the 'NOHUP' along with the '&', the process will be running in the background. Even when I attempt to close (Meaning 'EXIT') the session (say PUTTY in this case), it wont exit unless the process is completed.

But, say when I forcefully terminate the session (SHUT DOWN the machine). In this case, all the child processes will be terminated and the parent process will continue.

What I need is that, even though I forcefully terminate the session, I need both the CHILD and PARENT processes to run and complete successfully.

Exact Scenario: I'm running a UNIX (Parent) shell which in turn calls an ORACLE (Child) session. When I run it with �NOHUP' and �&' and terminate the session forcefully, the ORACLE session will terminate and will give to control to the UNIX session, which will run the remaining UNIX operation.
I don't want this to happen. Even though I forcefully terminate the session, I need both the ORACLE (Child) and UNIX (parent) session to run and complete normally.

Kindly advice.

Thanks,
Barani

There's not a lot you can do to keep a session that no longer exists, open. You could try the 'screen' utility, which apparently allows you to create login sessions that can be connected and disconnected from at will without killing or halting them.

I'm not to sure if I fully understand your situation, but have you tried running the scripts as another user?

Like

 sudo -u newuser nohup my.script & 

?

I would also say try to su - in and run the script, but I suppose when you exit that shell as well, you would have a similar problem?