Skip to content

Commit 0c9b68e

Browse files
llaurentdanielsdeleo
authored andcommitted
debian service provider fix for squeeze
in debian squeeze update-rc.d (sysv-rc) seems to use stderr for some of its ouput. As a result both stderr and stdout need to be read when checking for enabled services.
1 parent 608f1a3 commit 0c9b68e

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

chef/lib/chef/provider/service/debian.rb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ def service_currently_enabled?
5555
priority = {}
5656
enabled = false
5757

58-
stdout.each_line do |line|
59-
if UPDATE_RC_D_PRIORITIES =~ line
60-
priority[$1] = [($2 == "S" ? :start : :stop), $3]
61-
end
62-
if line =~ UPDATE_RC_D_ENABLED_MATCHES
63-
enabled = true
58+
[stdout, stderr].each do |iop|
59+
iop.each_line do |line|
60+
if UPDATE_RC_D_PRIORITIES =~ line
61+
priority[$1] = [($2 == "S" ? :start : :stop), $3]
62+
end
63+
if line =~ UPDATE_RC_D_ENABLED_MATCHES
64+
enabled = true
65+
end
6466
end
6567
end
6668
@current_resource.enabled enabled

0 commit comments

Comments
 (0)