Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: GNU nohup oddness



On Dec 9,  6:00pm, Peter Stephenson wrote:
} Subject: Re: GNU nohup oddness
}
} "Bart Schaefer" wrote:
} > @@ -870,7 +897,8 @@
} >      signal_ignore(SIGQUIT);
} >  #endif
} >  
} > -    install_handler(SIGHUP);
} > +    if (signal_ignore(SIGHUP) != SIG_IGN)
} > +	install_handler(SIGHUP);
} >      install_handler(SIGCHLD);
} >  #ifdef SIGWINCH
} >      install_handler(SIGWINCH);
} 
} Seems to be logical --- follow the parent process.
} 
} Is there a place where also setting opts[HUP] to zero would change the
} effect?

With signal_ignore(SIGHUP) any jobs started by that zsh _probably_ will
also ignore HUP -- but without opts[HUP] = 0, zsh still kill()s all jobs
at exit.  So with the patch above, background jobs _may_ die when the
script exits, even if the nohup wrapper was used to start the script.

Conversely, if opts[HUP] = 0, then zsh won't kill() even if the script
later un-ignores HUP by installing a trap handler, so background jobs
started by the script will survive even if the script itself is HUP'd.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   



Messages sorted by: Reverse Date, Date, Thread, Author