puppetlabs/puppet — pull request #2021 by glennsarti (2013-11-01 05:48:39+00:00)
Title: (#21641) Puppet Agent logs to Windows Eventlog

- daemon.bat is no longer required
The daemon.bat is no longer required and the Puppet Agent can be called directly using ruby.

Registry key to change;
HKLM\System\CurrentControlSet\Services\pe-puppet\ImagePath
"C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\sys\ruby\bin\ruby.exe" -rubygems -C"C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\service" "C:\Program Files (x86)\Puppet Labs\Puppet Enterprise\service\daemon.rb"
Substitute the appropriate source path. This path can be configured as part of the MSI installation

- daemon.rb modified for Windows EventLog logging to resolve Puppet Bug #21641. It does register an application source, which is the same as Puppet.
In the future it may make sense to split out the event source information. For the moment it is not required.

- daemon.rb modified to fix the behaiour of Puppet Agent terminating once Paused. Puppet Bug #22972

- daemon.rb modified to put the Puppet Agent run in an IF statement, which will only evaluate
as true if the service is in a RUNNING or IDLE state

- daemon.rb I think may have found a bug in the Win32 Daemon code which was taking
the service out of PAUSED and put it into a RUNNING state whenever a
SERVICE_INTERROGATE event is recieved. Issue logged with the authors of the Win32 Daemon Ruby code
https://github.com/djberg96/win32-service/issues/11

- daemon.rb I added in a little extra logging in the Resume and Pause events. I changed some of the wording in the main loop to reduce any confusion about "Service Resuming"