From: Gennady Bystritsky Date: 2006-09-27T06:36:47+09:00 Subject: Re: forking processes and writing to log file [CORRECTION] Gennady Bystritsky wrote: > logfile = "my_log_file.log" > pid = fork do > File.open(logfile, 'w') do |_io| > $stdout.reopen(_io) > $stderr.reopen(_io) > end > > Process.setsess # In this scenario disassociates the controlling > # terminal until another tty device is open (will > # become new controlling tty). > > exec "the_command_line_used_to_be_launched_by_system" > end > > Process.waitpid pid Process.setsess should be Process.setsid. Sorry for confusion, clicked on 'Send' too soon ;-). > > === > Gennady.