summaryrefslogtreecommitdiff
path: root/lib/chef/provider/service/solaris.rb
diff options
context:
space:
mode:
authorsawanoboly <sawanoboriyu@higanworks.com>2013-01-31 12:24:17 +0000
committerBryan McLellan <btm@opscode.com>2013-04-11 13:43:48 -0700
commitb76c62e98c1b22c3dd0050a9d6b86a9c93e970fa (patch)
tree26acca8a90f282042e85f2ffbe3746c6736cf015 /lib/chef/provider/service/solaris.rb
parent635390443442045c864cba794536a071dfd58a36 (diff)
downloadchef-b76c62e98c1b22c3dd0050a9d6b86a9c93e970fa.tar.gz
[CHEF-3772] Use the sync(-s) option to get exit status.
* svcadm to wait and return errors back to the provider * switch method from run_command to shellout!
Diffstat (limited to 'lib/chef/provider/service/solaris.rb')
-rw-r--r--lib/chef/provider/service/solaris.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/chef/provider/service/solaris.rb b/lib/chef/provider/service/solaris.rb
index 364b6f6542..33a29da109 100644
--- a/lib/chef/provider/service/solaris.rb
+++ b/lib/chef/provider/service/solaris.rb
@@ -16,6 +16,7 @@
# limitations under the License.
#
+require 'chef/mixin/shell_out'
require 'chef/provider/service'
require 'chef/mixin/command'
@@ -23,6 +24,7 @@ class Chef
class Provider
class Service
class Solaris < Chef::Provider::Service
+ include Chef::Mixin::ShellOut
def initialize(new_resource, run_context=nil)
super
@@ -42,23 +44,22 @@ class Chef
end
def enable_service
- run_command(:command => "#{default_init_command} enable #{@new_resource.service_name}")
- return service_status.enabled
+ shell_out!("#{default_init_command} enable -s #{@new_resource.service_name}")
end
def disable_service
- run_command(:command => "#{default_init_command} disable #{@new_resource.service_name}")
- return service_status.enabled
+ shell_out!("#{default_init_command} disable -s #{@new_resource.service_name}")
end
alias_method :stop_service, :disable_service
alias_method :start_service, :enable_service
def reload_service
- run_command(:command => "#{default_init_command} refresh #{@new_resource.service_name}")
+ shell_out!("#{default_init_command} refresh #{@new_resource.service_name}")
end
def restart_service
+ ## svcadm restart doesn't supports sync(-s) option
disable_service
return enable_service
end