summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaymala Sinha <jsinha@chef.io>2017-12-07 18:37:53 +0000
committerJaymala Sinha <jsinha@chef.io>2017-12-07 18:37:53 +0000
commitd027fce2386e6b82b6c991a0693beb282d5a7520 (patch)
tree46506785b0903b7a0f604a0263d018422fc79a98
parenta479d6613efa480c67f20893a413f92970dbe50e (diff)
downloadchef-jsinha/fix_solaris_service.tar.gz
Enable Service needs to check current service statusjsinha/fix_solaris_service
Signed-off-by: Jaymala Sinha <jsinha@chef.io>
-rw-r--r--lib/chef/provider/service/solaris.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/chef/provider/service/solaris.rb b/lib/chef/provider/service/solaris.rb
index 70b40f11ca..6a50ffffff 100644
--- a/lib/chef/provider/service/solaris.rb
+++ b/lib/chef/provider/service/solaris.rb
@@ -54,6 +54,7 @@ class Chef
end
def enable_service
+ service_status
shell_out!(default_init_command, "clear", @new_resource.service_name) if @maintenance
enable_flags = [ "-s", @new_resource.options ].flatten.compact
shell_out!(default_init_command, "enable", *enable_flags, @new_resource.service_name)
@@ -93,6 +94,9 @@ class Chef
# dependency require_all/error svc:/milestone/multi-user:default (online)
# $
+ # Set the default value for maintenance
+ @maintenance = false
+
# load output into hash
status = {}
cmd.stdout.each_line do |line|