diff options
author | Lance Albertson <lance@osuosl.org> | 2020-09-14 11:36:11 -0700 |
---|---|---|
committer | Lance Albertson <lance@osuosl.org> | 2020-09-15 14:04:36 -0700 |
commit | 993160c680fc99e6379d1486167653681e0ee247 (patch) | |
tree | caa83c84a8cc882823d66cc8ee851f85e00e5857 | |
parent | 607dce67ec26417161e1327295d35ab2eb86a972 (diff) | |
download | chef-993160c680fc99e6379d1486167653681e0ee247.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.rb | 14 |
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 |