opscode/chef — pull request #1092 by sersut (2013-10-25 16:15:48+00:00)
Title: Check before creating a new system mutex on windows.

This is needed when multiple user accounts are running chef-client on systems. This scenario is imminent when they configure chef to run as service on windows which by default runs as "Local System" and when they try to run chef client manually as Administrator.

NOTE: Non-admin users do not wait on the run_lock but can create a run_lock if there is not one already.

@adamedx can you test this out on your windows system to double check?

Here are the repro steps for the issue I've seen on my system:

1-) Install 11.8.0.rc.3 and enable chef service during installation.
2-) Use the below resource in the recipe and make a run
```ruby
ruby_block "sleeping..." do
block do
sleep 100
end
end
```
3-) Check c:\chef\client.log to make sure you have a chef run going on
4-) Run chef-client -l debug using Administrator account
5-) Run should fail with access denied.

To get the fix you can do:
1-) Get this fix and do a "rake gem" in your chef code directory
2-) Copy the mingw gem onto your windows box.
3-) Execute "gem uninstall chef on your windows box."
4-) Execute "gem install --local path_to_chef_gem"

After that repro steps shouldn't repro.

Also on a seperate note I've seen that non-admin users can make a chef-client run.