[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. puppet-0.24.5-rc3-1601-gf8c1b08

James Turnbull james at lovedthanlost.net
Fri Jan 15 09:08:38 UTC 2010


The following commit has been merged in the upstream branch:
commit fd631b9945cf33a1e5af849900cf6219b050e321
Author: Ricky Zhou <ricky at fedoraproject.org>
Date:   Fri Jan 1 15:39:36 2010 -0500

    Do not close stdout or stderr in execute.
    
    Closing stdout and stderr would sometimes cause failures when a program
    that is executed with squelched output tries to write to them.  This
    reverts to the previous behavior of reopening them to /dev/null.

diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb
index cc2822f..3752a6d 100644
--- a/lib/puppet/util.rb
+++ b/lib/puppet/util.rb
@@ -291,20 +291,23 @@ module Util
             begin
                 output_read.close
 
-                if arguments[:stdinfile]
-                    $stdin.reopen(arguments[:stdinfile])
-                else
-                    $stdin.close
-                end
                 if arguments[:squelch]
-                    $stdout.close
+                    output_write.close
+                    $stdout.reopen('/dev/null', 'w')
+                    $stderr.reopen('/dev/null', 'w')
                 else
                     $stdout.reopen(output_write)
+                    if arguments[:combine]
+                        $stderr.reopen(output_write)
+                    else
+                        $stderr.reopen('/dev/null', 'w')
+                    end
                 end
-                if arguments[:combine]
-                    $stderr.reopen(output_write)
+
+                if arguments[:stdinfile]
+                    $stdin.reopen(arguments[:stdinfile])
                 else
-                    $stderr.close
+                    $stdin.close
                 end
 
                 3.upto(256){|fd| IO::new(fd).close rescue nil}

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list