summaryrefslogtreecommitdiff
path: root/lib/chef/provider/service/macosx.rb
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-02-28 13:18:04 -0800
committerTim Smith <tsmith84@gmail.com>2020-02-28 13:18:04 -0800
commit4f1171efa9e5d8c6c07b795619c9c5cd46163b47 (patch)
tree27350bd9c29debe28f8ee7dabb770a31e8539129 /lib/chef/provider/service/macosx.rb
parent0d300feeeb305ab0caf487311b8a9933fe7d08f5 (diff)
downloadchef-4f1171efa9e5d8c6c07b795619c9c5cd46163b47.tar.gz
Remove support for macOS < 10.12 in the service resource
There's no reason to perform this check anymore since we only product packages for macOS 10.13 and later. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/provider/service/macosx.rb')
-rw-r--r--lib/chef/provider/service/macosx.rb15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/chef/provider/service/macosx.rb b/lib/chef/provider/service/macosx.rb
index 746581df73..2c74cb2629 100644
--- a/lib/chef/provider/service/macosx.rb
+++ b/lib/chef/provider/service/macosx.rb
@@ -1,6 +1,7 @@
#
# Author:: Igor Afonov <afonov@gmail.com>
# Copyright:: Copyright 2011-2016, Igor Afonov
+# Copyright:: Copyright 2020, Chef Software, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -42,10 +43,6 @@ class Chef
PLIST_DIRS = gather_plist_dirs
- def this_version_or_newer?(this_version)
- Gem::Version.new(node["platform_version"]) >= Gem::Version.new(this_version)
- end
-
def load_current_resource
@current_resource = Chef::Resource::MacosxService.new(@new_resource.name)
@current_resource.service_name(@new_resource.service_name)
@@ -59,10 +56,8 @@ class Chef
if @console_user
@console_user = Etc.getpwuid(::File.stat("/dev/console").uid).name
logger.trace("#{new_resource} console_user: '#{@console_user}'")
- cmd = "su "
- param = this_version_or_newer?("10.10") ? "" : "-l "
- param = "-l " if this_version_or_newer?("10.12")
- @base_user_cmd = cmd + param + "#{@console_user} -c"
+ cmd = "su -l"
+ @base_user_cmd = cmd + "#{@console_user} -c"
# Default LaunchAgent session should be Aqua
@session_type = "Aqua" if @session_type.nil?
end
@@ -140,10 +135,10 @@ class Chef
end
end
- # On OS/X, enabling a service has the side-effect of starting it,
+ # On macOS, enabling a service has the side-effect of starting it,
# and disabling a service has the side-effect of stopping it.
#
- # This makes some sense on OS/X since launchctl is an "init"-style
+ # This makes some sense on macOS since launchctl is an "init"-style
# supervisor that will restart daemons that are crashing, etc.
def enable_service
if @current_resource.enabled