chef-client: Setting node["chef_client"]["interval"] seems to be ignored for Windows service

I installed chef-client 12.0.3 via bootstrap onto a Windows 8.1 machine. I used the default chef-client recipe to install the windows chef-client service. I’m trying to set the interval for the service to run to 5 mins.

I have a base role set for the windows node:

name "base"
description "Base role"
run_list "recipe[chef-client]"
default_attributes 
override_attributes "chef_client" => { "interval" => "300" }

The chef-client windows service gets installed correctly but it runs at the default of 1800 seconds. I’ve tried a few different ways of setting the attribute but nothing seems to budge it from the default.

The documentation (https://github.com/opscode-cookbooks/chef-client#attributes) says:

The following attributes affect the behavior of the chef-client program when running as a service through one of the service recipes, or in cron with the cron recipe, or are used in the recipes for various settings that require flexibility.

  • node[“chef_client”][“interval”] - Sets Chef::Config[:interval] via command-line option for number of seconds between chef-client daemon runs. Default 1800.

I’ve looked through the source code of the chef-client recipe and executable but can’t find how the interval is set via command-line option when using the windows service recipe. Do I have to set the interval attribute myself in client.rb?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 28 (12 by maintainers)

Most upvoted comments

Was this finally fixed ? I am still seeing similar behavior with Chef-Client v12.5.1 and Chef-Client cookbook version v4.3.3 on a Windows Server 2012 R2.

NVM - got it to work 😃 I had incorrectly set the override environment attributes.