Ticket #565: exec_hacking_01.patch
| File exec_hacking_01.patch, 1.5 kB (added by mccune, 2 years ago) |
|---|
-
lib/puppet/util.rb
old new 293 293 294 294 @@os ||= Facter.value(:operatingsystem) 295 295 output = nil 296 require 'rubygems' 297 require 'ruby-debug' 298 Debugger.start 296 299 IO.popen("-") do |f| 297 300 if f 301 # debugger 298 302 output = f.read 299 303 else 300 304 begin 301 $stdin.reopen("/dev/null")305 # $stdin.reopen("/dev/null") 302 306 $stderr.close 303 307 $stderr = $stdout.dup 304 308 if gid … … 309 313 Process.euid = uid 310 314 Process.uid = uid unless @@os == "Darwin" 311 315 end 312 if command.is_a?(Array) 313 Kernel.exec(*command) 314 else 315 Kernel.exec(command) 316 Kernel.fork do 317 if command.is_a?(Array) 318 Kernel.exec(*command) 319 else 320 Kernel.exec(command) 321 end 316 322 end 323 Process.wait 324 $stdout.close 325 exit!($?.exitstatus) 317 326 rescue => detail 318 327 puts detail.to_s 319 328 exit!(1)