How to test disown and nohup commands ?
Hi,
I ran a perl script in background with nohup and disown to make sure my script runs even after the parent process is terminated.
Method 1: nohup
> nohup perl run.pl &
[1] 2080
Method 2: disown
> perl run.pl &
[2] 2448
> disown
In either method, the script process doesn't seem to connect to init process, when I checked using pstree command. I thought, the disown or nohup command detaches the process from its parent and attaches it to grand grand parent init process. And it disables SIGHUP signal to my script process.
But the pstree command didn't show me what I expected. It still shows my script process attached to my current terminal process.
I just don't understand the concept behind these two commands (nohup and disown). Is there any way, I can see the list of processes that are run by nohup or disown command ?
Thanks in advance
Jagadish
|