diff options
author | Jaymala Sinha <jsinha@chef.io> | 2017-12-07 18:37:53 +0000 |
---|---|---|
committer | Jaymala Sinha <jsinha@chef.io> | 2017-12-07 14:48:12 -0500 |
commit | 1aa8abbb0e5ae63aa34e6f31b87bbde9d7278a79 (patch) | |
tree | a86c175d3b8293a4b64aa318af5319c8dc4f7d7a /lib/chef/provider/service | |
parent | a479d6613efa480c67f20893a413f92970dbe50e (diff) | |
download | chef-1aa8abbb0e5ae63aa34e6f31b87bbde9d7278a79.tar.gz |
Fix svcadm clear to only run in maintenance statejsinha/fix_svcadm
Signed-off-by: Jaymala Sinha <jsinha@chef.io>
Signed-off-by: Patrick Wright <patrick@chef.io>
Diffstat (limited to 'lib/chef/provider/service')
-rw-r--r-- | lib/chef/provider/service/solaris.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/chef/provider/service/solaris.rb b/lib/chef/provider/service/solaris.rb index 70b40f11ca..f2b1ec4262 100644 --- a/lib/chef/provider/service/solaris.rb +++ b/lib/chef/provider/service/solaris.rb @@ -54,6 +54,8 @@ class Chef end def enable_service + # Running service status to update maintenance status to invoke svcadm clear + 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 +95,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| |