On Apr 24, 2009, at 11:01 AM, Gary Wright wrote: > On Apr 24, 2009, at 11:11 AM, Tim Pease wrote: >> >> This is the standard code to daemonize a process. The use of "exit" >> bothers me slightly, as it will call all "at_exit" handlers in the >> parent. I do not believe this is the desired behavior; the "at_exit" >> handlers will free resources that the daemonized process might need. > > What resources are you talking about? By the time exit is called, the > process has already been duplicated. The child process won't be > affected > by anything the parent does during via at_exit processing (at least > with respect to Ruby object resources). But if that at_exit() handler deletes a file or something Anyway, I do use exit!() in my daemonize() method.