summaryrefslogtreecommitdiff
path: root/ext/windows
AgeCommit message (Collapse)AuthorFilesLines
2014-08-14(PUP-2987) Restructure Windows service codeEthan J. Brown1-16/+25
- Move runinterval parsing and execution of the puppet agent to a new thread that maintains a busyloop until either: - the service is no longer running - an exception has occurred with parsing the runinterval - Rather than performing a wakeup against the main thread, simply kill this new thread on service_stop - Main service code will wait until the busyloop thread dies, then will exit - Note that this change is ultimately not responsible for the service hangs experienced in the service. Additional changes have been made to the win32-service gem to ensure events being waited on with WaitForSingleObject are always signaled properly, even in failure cases. Please see merged PR for more info: https://github.com/djberg96/win32-service/pull/21 https://github.com/puppetlabs/puppet-win32-ruby/pull/51
2014-08-04(PUP-2987) Windows service runinterval parsingEthan J. Brown1-10/+16
- Refactor parsing code to a separate method to cleanup run loop
2014-07-16(PUP-1471) Remove warning message about pausing Windows agent serviceglenn.sarti1-4/+1
Puppet agent on windows now uses a win32-service gem which is 0.8.4 or greater[1,2]. The warning message and inline comments are no longer required now that the upstream bug was fixed[3]. [1] https://github.com/puppetlabs/puppet/commit/5a5e685bf835fb459d036d31f0078668f5802331 [2] https://github.com/puppetlabs/puppet/commit/784c3d17c4d3e666701559c529e46465e5dc417e [3] https://github.com/djberg96/win32-service/commit/38eba9f1edee41c9fb1d89fc3dea11da0768baf9
2014-07-07(PUP-2889) Remove dependency on win32-eventlog constantsJosh Cooper1-9/+8
Previously, we were referencing win32-eventlog constants. However, version 0.6.0 introduced a backwards incompatible change by renaming the event type constants[1]. As result, we can't simply upgrade to the latest ffi gem. This commit defines the constants in puppet, and removes our dependence on the gem. It also adds eventlog specs, in particular to ensure that Puppet.features.eventlog? is always true on windows. [1] https://github.com/djberg96/win32-eventlog/commit/99aeb4d854306a6db699550884f189cbd3c8928a
2014-06-26(PUP-2521) Remove windows-pr mixins from daemonEthan J. Brown1-6/+0
- synchronize and handle appear to no longer be used
2014-06-26(PUP-2521) Define Process constants locallyEthan J. Brown1-2/+3
- Previously, Process constants were used in a few locations throughout the code. Capture the needed PRIORITY_CLASS constants in our local Windows Process class, and also define CREATE_NEW_CONSOLE. These constants have moved in new versions of the win32-process gem. - Note that ext/windows/service/daemon.rb doesn't load Puppet code. The daemon only loads what it explicitly needs, so ensure the CREATE_NEW_CONSOLE constant is defined there.
2014-06-24Revert "Merge branch 'pr/2801'"Josh Cooper1-7/+0
This reverts commit ea304a00efd5aa5837ab74979b60a1597d4eb82d, reversing changes made to b9a0cb902a8a77635d1c0fba99a5a4ebad8197c1.
2014-06-24(PUP-2828) puppet-win32-ruby acceptance ver configEthan J. Brown1-0/+7
- Previously, Jenkins acceptance jobs on Windows would clone Windows source for puppet-win32-ruby, the vendored Ruby that we ship as part of Windows MSI builds. This comes from an internal git mirror. - At present, a simple checkout is performed against whatever is the 'default' branch (typically the 1.9.3 branch). Unfortunately, this will not work for any acceptance jobs that intend to use 2.0, and it currently doesn't work for jobs that need new versions of gems. - Rather than take a 'clone the repo and hope it works' approach, make use of Beaker's :rev option when calling install_from_git. https://github.com/puppetlabs/beaker/blob/beaker1.11.2/lib/beaker/dsl/install_utils.rb#L106 - Using :rev allows us to pin the repo version by using an environment variable that can be setup in the Jenkins job. Track the relevant SHAs with the modified code so that dependent versions are tracked in the source tree, rather than through transient Jenkins jobs. - To allow the jobs to build a particular architecture, introduce a new environment variable called WIN32_RUBY_ARCH that can be used to select either 'x86' or 'x64'. If an arch is not specified, fall back to 'x86', but if the appropriate :rev is not specified, kill the setup step.
2014-01-30(PUP-1278) Updating Windows service event messages.Peter Huene1-10/+9
Changing the service startup message to not include the agent parameters. This will now only be printed when actually doing the agent run. Removing the "service running" message from the loop as this prints out repeatedly even if the service is paused. Moving determining the path to puppet to outside the run loop.
2014-01-25(PUP-1278) Windows Puppet Agent Service gracefully terminates after ↵glenn.sarti1-4/+6
succesfully being put into a Paused state Removed redundant return statement Added in logic to only start the Puppet Agent if the service is in a Running or Idle state
2014-01-21(PUP-1048) Windows puppet service should log to the eventlogglennsarti1-11/+37
Cleaned up some whitespace issues Changed the wording on some of the log entries to avoid confusion between 'Service resuming' and a Service Resume control message Added logging for the Pause, Resume and Shutdown service control messages. Previously there was none Noted Bug id 11 in the win32-service ruby code Added a commented out handler for the Interrogation event for debuggin purposes Changed the name of the event log function from raise_windows_event to report_windows_event to avoid connotations with raise Changed the event source to Puppet so that the correct event source DLL is used. However it may be a good idea to split the event source between the service and the actual agent so it's easier to read in the Eventlog. This would require a change to the puppet_for_the_win repo as well. The eventlog.close command is within an ensure block to stop leaked handles if an error occurs The --logtofile argument was working for the service but was causing the puppet agent run to fail as it didn't know what to do with it. Used a simple text substitution to remove it from the args string. Spelling mistake Rebasing broke detecting of the --logtofile argument. Changed the variable used Changed wording of the log message when putting the service into a paused state. Now references a Puppet Issue ticket for tracking The ensure block will make sure that the eventlog handle is not nil before trying to close the handle
2014-01-21(PUP-1048) Windows puppet service should log to the eventlogglennsarti1-3/+54
Initial attempt to add in eventlogging for all log messages New service command line argument (--logtofile). By default the service will log all messages to the Eventlog. This argument will log messages both to the Eventlog and the Puppet log file in Common Application Data. This can be useful if the EventLog logging is failing or another application depends on the the logfile Basic tests show the new code works however more testing should be done
2013-12-17(#23219) - Fix support of extra arguments in windows serviceLuis Fernandez Alvarez1-3/+4
Without this patch, extra arguments specified in the service definition are not parsed correctly by the service class.
2013-08-29(#22258) Create new console for each puppet runEric Badger1-1/+1
Powershell apparently has some issue trying to share the Windows service's console when running under ruby.exe (as opposed to rubyw.exe). This patch causes the service to create a new console for each puppet child it kicks off, which resolves the issue.
2013-06-24(#21043) Use ruby.exe instead of rubyw.exeJosh Cooper1-1/+1
Previously, if you set a custom runinterval setting in puppet.conf, puppet running on ruby 1.9 would ignore it, whereas it would work in ruby 1.8. The root cause is due to http://bugs.ruby-lang.org/issues/7239. In ruby 1.9, rubyw.exe is unable to read the stdout of any child process using ruby's built-in process methods, e.g. %x. This affects us, because the windows service, running as rubyw.exe, executes: `%x{ puppet agent --configprint runinterval}` to obtain the current runinterval setting. The bug is fixed in ruby 2.0, so for now, we just switch to using `ruby.exe` instead of `rubyw.exe`.
2012-11-26(#17554) Use agent run_mode when resolving runintervalJosh Cooper1-1/+1
Previously, the windows service was invoking `puppet config print runinterval` to determine how frequently to invoke the puppet agent. However, that only takes into account the main section, not the agent section, and runinterval is agent-specific. This commit changes the windows service to invoke `puppet agent --configprint runinterval` which takes into account the agent section of the settings.
2012-10-08(#16757) Don't require rubygemsJosh Cooper2-2/+2
Previously, the windows service code was explicitly requiring rubygems. While not breaking anything, it's not desirable, as the environment should load rubygems, or not, instead of the service code itself. This code changes the daemon batch file to execute rubyw with rubygems support enabled. Paired-with: Andy Parker <andy@puppetlabs.com>
2012-09-11Moving windows service into the ext directory.Matthaus Litteken2-0/+96
2012-08-31Move all packaging artifacts from conf to extMoses Mendoza3-0/+50
This commit moves all packaging artifacts out of the conf dir and into the ext dir. This is generally a move to align packaging across all puppetlabs products and make the directories more sensible, e.g. conf should have config files. The redhat spec and install.rb are updated for the path change. Signed-off-by: Moses Mendoza <moses@puppetlabs.com>