From: Pra Bhandar Date: 2009-05-28T07:38:10+09:00 Subject: Process Leak after using Session module Hi, This script has a process leak with a bash session being left open every time I run it. I can't find a way to close the bash object after I am done. Docs don't explicitly don't cover this.. or I am missing something simple. Can anyone shed some light on this or point to docs that I may not be aware of? I looked at the readme provided by Sessions module authors so far. Thanks in advance. Prakash bash = Session::Shell.new oratab_file = Oratab() ofile = File.open(oratab_file, "r") ############################################################ # Looping through all lines ############################################################ bash.execute ">instancestatus-output.txt" ofile.each { |oratab_line| if oratab_line =~ /^\s+/ else if oratab_line =~ /^#/ else if oratab_line =~ /^\+/ else db_str = db_and_flag(oratab_line) db_arr = db_str.split(",") db_name = db_arr[0] puts db_name ######################################################### # Make calls to the right database calls right here ########################################################## bash.execute "echo #{db_name}:>>instancestatus-output.txt" bash.execute "InstanceStatus.sh #{db_name}", 1 => STDOUT, 2 => STDERR do |out,err| puts out if out puts err if err end ########################################################## # End of loop for bash.execute ########################################################## end end end # /* end of the ofile.each statement */ ################################################################# # # ################################################################# } end -- Posted via http://www.ruby-forum.com/.