{"action":"created","issue":{"url":"https://api.github.com/repos/chef/chef/issues/3432","labels_url":"https://api.github.com/repos/chef/chef/issues/3432/labels{/name}","comments_url":"https://api.github.com/repos/chef/chef/issues/3432/comments","events_url":"https://api.github.com/repos/chef/chef/issues/3432/events","html_url":"https://github.com/chef/chef/issues/3432","id":81151511,"number":3432,"title":"Windows service ignores interval setting","user":{"login":"echohack","id":3253989,"avatar_url":"https://avatars.githubusercontent.com/u/3253989?v=3","gravatar_id":"","url":"https://api.github.com/users/echohack","html_url":"https://github.com/echohack","followers_url":"https://api.github.com/users/echohack/followers","following_url":"https://api.github.com/users/echohack/following{/other_user}","gists_url":"https://api.github.com/users/echohack/gists{/gist_id}","starred_url":"https://api.github.com/users/echohack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echohack/subscriptions","organizations_url":"https://api.github.com/users/echohack/orgs","repos_url":"https://api.github.com/users/echohack/repos","events_url":"https://api.github.com/users/echohack/events{/privacy}","received_events_url":"https://api.github.com/users/echohack/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chef/chef/labels/Windows","name":"Windows","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-05-26T21:48:42Z","updated_at":"2015-06-30T06:04:15Z","closed_at":null,"body":"Windows won't respect the interval/splay set on the node.\r\n\r\nTo quoth the documentation:\r\n\r\n    node[\"chef_client\"][\"interval\"] - Sets Chef::Config[:interval] via command-line option for number of seconds between chef-client daemon runs. Default 1800.\r\n    node[\"chef_client\"][\"splay\"] - Sets Chef::Config[:splay] via command-line option for a random amount of seconds to add to interval. Default 300.\r\n\r\nSince Windows doesn't respect the above settings, it leads to the \"workaround\" of wanting to set it in the client.rb using ['chef_client']['config']['interval'] and ['chef_client']['config']['splay'], but this makes manual runs impossible to instantly execute. Windows WILL respect the settings for regular check-in runs in the client.rb.\r\n\r\nPersonally we think it's more painful to have to wait for manual runs (if we do a manual run, we want it to go NOW), so we choose just to use the default built in 30 minutes interval and 5 minute splay... but we'd like to be able to set this so it can be in accordance with our policy in our base cookbook.\r\n\r\n\r\nSee: https://github.com/opscode-cookbooks/chef-client/issues/235 for a full discussion of this issue."},"comment":{"url":"https://api.github.com/repos/chef/chef/issues/comments/116991259","html_url":"https://github.com/chef/chef/issues/3432#issuecomment-116991259","issue_url":"https://api.github.com/repos/chef/chef/issues/3432","id":116991259,"user":{"login":"jeremiahsnapp","id":430911,"avatar_url":"https://avatars.githubusercontent.com/u/430911?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremiahsnapp","html_url":"https://github.com/jeremiahsnapp","followers_url":"https://api.github.com/users/jeremiahsnapp/followers","following_url":"https://api.github.com/users/jeremiahsnapp/following{/other_user}","gists_url":"https://api.github.com/users/jeremiahsnapp/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremiahsnapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremiahsnapp/subscriptions","organizations_url":"https://api.github.com/users/jeremiahsnapp/orgs","repos_url":"https://api.github.com/users/jeremiahsnapp/repos","events_url":"https://api.github.com/users/jeremiahsnapp/events{/privacy}","received_events_url":"https://api.github.com/users/jeremiahsnapp/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T06:04:15Z","updated_at":"2015-06-30T06:04:15Z","body":"@lamont-granquist and @juliandunn I just added a [large comment](https://github.com/opscode-cookbooks/chef-client/issues/235#issuecomment-116989556) that should give a better explanation of this problem.\r\n\r\nHere is the summary of the direction I'm suggesting for a fix.\r\n\r\nThe Windows service can be configured in a manner similar to the Linux service. The interval and splay can be set in the following registry key which defines the command that starts the Windows service.\r\n\r\n```\r\nComputer\\HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\chef-client\\ImagePath\r\n```\r\n\r\nCurrently the default value for ImagePath is `\"C:\\opscode\\chef\\embedded\\bin\\ruby\" \"C:\\opscode\\chef\\bin\\chef-windows-service\" -c C:\\chef\\client.rb -L C:\\chef\\log\\client.log`. Simply appending ` -i 700 -s 30` to that value and restarting the service correctly sets the interval and splay for the service while still allowing for manually running chef-client immediately.\r\n\r\nSome work needs to be done to both the `chef-client` cookbook as well as the Chef Client code in order to really fix this but it doesn't look very complicated.\r\n\r\nThe following link shows the `chef-service-manager` command that the `chef-client` cookbook uses to install chef as a service. This is where the chef-client cookbook needs to append new options for the interval and splay.\r\n\r\nhttps://github.com/opscode-cookbooks/chef-client/blob/v4.3.0/recipes/windows_service.rb#L33\r\n\r\nThe following links show where the new interval and splay options would need to be defined in the `chef-service-manager` code.\r\n\r\nhttps://github.com/chef/chef/blob/12.4.0/lib/chef/application/windows_service_manager.rb#L45-L55\r\nhttps://github.com/chef/chef/blob/12.4.0/lib/chef/application/windows_service_manager.rb#L107-L109\r\n"}}