Should I run chef-client on Windows as a 'service' or a 'scheduled task'?

Peter Burkholder -

Chef Client as a scheduled task is generally preferable to a service, as it provides better visibility, more configurability, and fewer issues around log rotation and permissions. The Windows Cookbook has support for scheduled tasks.

In more detail:

  • chef-client as a Windows Service has issues with log rotation, which can lead to filling a disk partition. The scheduled task does not have that problem
  • status of chef-client as a Windows Service can be indeterminate. The "running" status might indicate only the watcher is working, not the entire chef-client service
  • chef-client as a Windows Service can have issues with insufficient permissions depending on the service context. Scheduled task is less likely to have such issues
  • chef-client as a scheduled task is less likely to have issues upon system reboot. If the network stack is not fully available when the service starts, the chef-client service may come up in a "wedged" state.

When using chef-client as a scheduled task it's important to stagger the task execution times across your clients to avoid regularlly overloading your Chef Server. Support for adding a random delay will available in a future release of the Windows Cookbook

Have more questions? Submit a request

Comments

Powered by Zendesk