summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLance Albertson <lance@osuosl.org>2020-09-14 11:36:11 -0700
committerLance Albertson <lance@osuosl.org>2020-09-14 11:36:11 -0700
commit7c90f3e147b68701362437369a6edbeadd4af6e5 (patch)
tree93d3ed009c2cf359899d6e27a73de19a0b329b49
parentc30cb75ab7bd73c3b162d1d984e3e7ff48b876a2 (diff)
downloadchef-7c90f3e147b68701362437369a6edbeadd4af6e5.tar.gz
Update dist constants in chef_client_launchd to use chef-utils
Signed-off-by: Lance Albertson <lance@osuosl.org>
-rw-r--r--lib/chef/resource/chef_client_launchd.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/chef/resource/chef_client_launchd.rb b/lib/chef/resource/chef_client_launchd.rb
index 68e6f7324b..0e173050d0 100644
--- a/lib/chef/resource/chef_client_launchd.rb
+++ b/lib/chef/resource/chef_client_launchd.rb
@@ -110,7 +110,7 @@ class Chef
end
end
- launchd "com.#{Chef::Dist::SHORT}.#{Chef::Dist::CLIENT}" do
+ launchd "com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}" do
username new_resource.user
working_directory new_resource.working_directory
start_interval new_resource.interval * 60
@@ -127,14 +127,14 @@ class Chef
# to restart itself. If the chef-client process uses launchd or macosx_service resources to restart itself
# we'll end up with a stopped service that will never get started back up. Instead we use this daemon
# that triggers when the chef-client plist file is updated, and handles the restart outside the run.
- launchd "com.#{Chef::Dist::SHORT}.restarter" do
+ launchd "com.#{ChefUtils::Dist::Infra::SHORT}.restarter" do
username "root"
- watch_paths ["/Library/LaunchDaemons/com.#{Chef::Dist::SHORT}.#{Chef::Dist::CLIENT}.plist"]
+ watch_paths ["/Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist"]
standard_out_path ::File.join(new_resource.log_directory, new_resource.log_file_name)
standard_error_path ::File.join(new_resource.log_directory, new_resource.log_file_name)
program_arguments ["/bin/bash",
"-c",
- "echo; echo #{Chef::Dist::PRODUCT} launchd daemon config has been updated. Manually unloading and reloading the daemon; echo Now unloading the daemon; launchctl unload /Library/LaunchDaemons/com.#{Chef::Dist::SHORT}.#{Chef::Dist::CLIENT}.plist; sleep 2; echo Now loading the daemon; launchctl load /Library/LaunchDaemons/com.#{Chef::Dist::SHORT}.#{Chef::Dist::CLIENT}.plist"]
+ "echo; echo #{ChefUtils::Dist::Infra::PRODUCT} launchd daemon config has been updated. Manually unloading and reloading the daemon; echo Now unloading the daemon; launchctl unload /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist; sleep 2; echo Now loading the daemon; launchctl load /Library/LaunchDaemons/com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}.plist"]
action :enable # enable creates the plist & triggers service restarts on change
end
@@ -149,12 +149,12 @@ class Chef
end
action :disable do
- service Chef::Dist::PRODUCT do
- service_name "com.#{Chef::Dist::SHORT}.#{Chef::Dist::CLIENT}"
+ service ChefUtils::Dist::Infra::PRODUCT do
+ service_name "com.#{ChefUtils::Dist::Infra::SHORT}.#{ChefUtils::Dist::Infra::CLIENT}"
action :disable
end
- service "com.#{Chef::Dist::SHORT}.restarter" do
+ service "com.#{ChefUtils::Dist::Infra::SHORT}.restarter" do
action :disable
end
end