Skip to content

Commit

Permalink
[windows] Try to start NPM only when network_enabled is true (#803)
Browse files Browse the repository at this point in the history
On Windows, set sysprobe_enabled to true only when node['datadog']['system_probe']['network_enabled'] is true, to prevent operations on the system-probe service when it is not installed.
  • Loading branch information
KSerrania authored Aug 10, 2021
1 parent 39ad158 commit a51c303
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion recipes/system-probe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
is_windows = platform_family?('windows')

# Set the correct agent startup action
sysprobe_enabled = node['datadog']['system_probe']['enabled'] || node['datadog']['system_probe']['network_enabled']
sysprobe_enabled = if is_windows
node['datadog']['system_probe']['network_enabled']
else
node['datadog']['system_probe']['enabled'] || node['datadog']['system_probe']['network_enabled']
end
sysprobe_agent_start = sysprobe_enabled ? :start : :stop

#
Expand Down

0 comments on commit a51c303

Please sign in to comment.