diff options
author | kaustubh-d <kaustubh@clogeny.com> | 2014-08-25 16:01:21 +0530 |
---|---|---|
committer | kaustubh-d <kaustubh@clogeny.com> | 2014-08-25 16:01:21 +0530 |
commit | 4c88754529539a2f80260094e81863aab03bb857 (patch) | |
tree | 4d2e4cb2cb0d7dcd45f5224ef391aedf6324db18 /lib | |
parent | 34c89dff6a872cc4d426f78aa2715af354ad1305 (diff) | |
download | mixlib-shellout-4c88754529539a2f80260094e81863aab03bb857.tar.gz |
remove #clean_parent_file_descriptors which is not required now.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/mixlib/shellout/unix.rb | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/mixlib/shellout/unix.rb b/lib/mixlib/shellout/unix.rb index 2456f49..f93d2e5 100644 --- a/lib/mixlib/shellout/unix.rb +++ b/lib/mixlib/shellout/unix.rb @@ -211,31 +211,6 @@ module Mixlib STDIN.sync = true if input end - # When a new process is started with chef, it shares the file - # descriptors of the parent. We clean the file descriptors - # coming from the parent to prevent unintended locking if parent - # is killed. - # NOTE: After some discussions we've decided to iterate on file - # descriptors upto 256. We believe this is a reasonable upper - # limit in a chef environment. If we have issues in the future this - # number could be made to be configurable or updated based on - # the ulimit based on platform. - def clean_parent_file_descriptors - # Don't clean $stdin, $stdout, $stderr, process_status_pipe. - 3.upto(256) do |n| - # We are checking the fd for error pipe before attempting to - # create a file because error pipe will auto close when we - # try to create a file since it's set to CLOEXEC. - if n != @process_status_pipe.last.to_i - begin - fd = File.for_fd(n) - fd.close if fd - rescue - end - end - end - end - def configure_parent_process_file_descriptors # Close the sides of the pipes we don't care about stdin_pipe.first.close @@ -309,8 +284,6 @@ module Mixlib configure_subprocess_file_descriptors - clean_parent_file_descriptors - set_group set_user set_environment |