Skip to content

Commit

Permalink
Back out "Replace cpe_launchd with fb_launchd"
Browse files Browse the repository at this point in the history
Summary:
Fixing fleet for now

Reviewed By: achand

Differential Revision: D20153983

fbshipit-source-id: bba3e430f804c2bf41869b15311cced0d712c34f
  • Loading branch information
steelcowboy authored and facebook-github-bot committed Feb 28, 2020
1 parent fa9cd4a commit 3671f41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
action :prompt do
dpn = node['cpe_deprecation_notifier'].to_h
la_path = '/Library/LaunchAgents'
domain = 'deprecationnotifier'
fname = "#{node['fb_launchd']['prefix']}.#{domain}"
launchagent_path = "#{la_path}/#{fname}.plist"
domain = "#{node['cpe_launchd']['prefix']}.deprecationnotifier"
launchagent_path = "#{la_path}/#{domain}.plist"

if dpn['install']
# Force a re-install if someone has removed the binary
Expand All @@ -40,7 +39,7 @@
version dpn['version']
checksum dpn['checksum']
receipt dpn['pkg_reciept']
notifies :restart, "launchd[#{fname}]" if dpn['enable']
notifies :restart, "launchd[#{domain}]" if dpn['enable']
end
end

Expand All @@ -53,7 +52,7 @@
owner 'root'
group 'wheel'
mode '0755'
notifies :restart, "launchd[#{fname}]"
notifies :restart, "launchd[#{domain}]"
notifies :write, 'mac_os_x_userdefaults[Reset Timeout]'
end

Expand Down Expand Up @@ -99,15 +98,15 @@
log_vars('expected_version', 'fail')
if log_if(dpn['conf']['expectedVersion'].to_s) { should_launch }
dp_bin = "#{dpn['path']}/Contents/MacOS/DeprecationNotifier"
node.default['fb_launchd']['jobs'][domain] = {
node.default['cpe_launchd'][domain] = {
'program_arguments' => [dp_bin],
'run_at_load' => true,
'type' => 'agent',
}
end

# To be used only for restarting
launchd fname do # ~FC009
launchd domain do # ~FC009
only_if { ::File.exist?(launchagent_path) }
type 'agent'
action :nothing
Expand Down
2 changes: 1 addition & 1 deletion itchef/cookbooks/cpe_nomad/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '0.1.0'

depends 'fb_launchd'
depends 'cpe_launchd'
depends 'cpe_logger'
depends 'cpe_profiles'

0 comments on commit 3671f41

Please sign in to comment.