mixlib-shellout 1.4.0.rc.0 → 1.4.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abc0fcb2fac6bbaa656ec5986083c3e6d9f80137
4
- data.tar.gz: bed2f4cda27c43e7f4a8bd1265089bf7b8016065
3
+ metadata.gz: cdcad8407f8158cacdc7118e4c2b046bf59f68e3
4
+ data.tar.gz: 1a27d08ae83ffca194ba8b61a6c23824b248b2bd
5
5
  SHA512:
6
- metadata.gz: c580694c90a79f7ef01b3e4b7930e954a77ece31f3a16e0b6d10ef02ea24d73e26f4de316f5fdd0cb4ca0162fbde9a303e763c992acf6bffef65ca2bb99dddd3
7
- data.tar.gz: 5c7af3ef8b2bb9f5e7ef9e36dce50f94afc0d3ce56702ac6e6bd45343cc367fe057ea7ad8b04881e6d0aaaebcaffd45ae95f9d69bf3e36ea385127f2f023b61b
6
+ metadata.gz: b5e1eac1c26c3b3d5e94c810e6a17a066470a034be3b5c8c1d08b8766a3618b08cebe3191b21f9ec6a2b3d0e250a36b45e0739e5e58df0d0649644ea38cae9f0
7
+ data.tar.gz: 557b314096cbe7f16aae32919d51b266c0bed4f44d20bc75b343d042add8c9ba79b6915d7be8b1ee5625573b2a867569f0e0de1f97e1e52dd096aee61d662a4e
@@ -63,7 +63,7 @@ module Mixlib
63
63
  # CHEF-3390: Marshall.load on Ruby < 1.8.7p369 also has a GC bug related
64
64
  # to Marshall.load, so try disabling GC first.
65
65
  propagate_pre_exec_failure
66
- @child_pgid = -Process.getpgid(@child_pid)
66
+ get_child_pgid
67
67
 
68
68
  @result = nil
69
69
  @execution_time = 0
@@ -107,6 +107,18 @@ module Mixlib
107
107
 
108
108
  private
109
109
 
110
+ def get_child_pgid
111
+ # The behavior of Process.getpgid (see also getpgid(2) ) when the
112
+ # argument is the pid of a zombie isn't well specified. On Linux it
113
+ # works, on OS X it returns ESRCH (which ruby turns into Errno::ESRCH).
114
+ #
115
+ # If the child dies very quickly, @child_pid may be a zombie, so handle
116
+ # ESRCH here.
117
+ @child_pgid = -Process.getpgid(@child_pid)
118
+ rescue Errno::ESRCH
119
+ @child_pgid = nil
120
+ end
121
+
110
122
  def set_user
111
123
  if user
112
124
  Process.euid = uid
@@ -137,6 +149,10 @@ module Mixlib
137
149
 
138
150
  # Process group id of the child. Returned as a negative value so you can
139
151
  # put it directly in arguments to kill, wait, etc.
152
+ #
153
+ # This may be nil if the child dies before the parent can query the
154
+ # system for its pgid (on some systems it is an error to get the pgid of
155
+ # a zombie).
140
156
  def child_pgid
141
157
  @child_pgid
142
158
  end
@@ -1,5 +1,5 @@
1
1
  module Mixlib
2
2
  class ShellOut
3
- VERSION = "1.4.0.rc.0"
3
+ VERSION = "1.4.0.rc.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-shellout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.rc.0
4
+ version: 1.4.0.rc.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Opscode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-30 00:00:00.000000000 Z
11
+ date: 2014-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec