HomePhorge

Add basic service provider for Windows
3be4d79d288fUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Add basic service provider for Windows

This provider allows us to query the system state through "puppet
resource", and manage the ensure, and enabled properties of services on
Windows.

This also adds support for a new enabled value of 'manual' on Windows
only. With this we support the three major start types for services on
Windows, with the following mapping of enabled to start type:

true   => Automatic
false  => Disabled
manual => Manual (Demand)

We use the win32-service gem to provide access to the Windows APIs for
our operations. This does add a new gem requirement for running Puppet
on Windows, but we were already requiring some gems from the same suite
that win32-service is a part of.

When referring to a service, the simple service name must be used,
instead of the display name. For example, "snmptrap", instead of
"SNMP Trap".

All system services are reported in 'puppet resource service',
including those started prior to run level 3 (system, device drivers,
etc.). These services should probably not be managed, without careful
thought and planning.

This currently does not support being able to move a service from
{enabled => false, ensure => stopped} to {enabled => true, ensure =>
running} (or enabled => manual) in a single Puppet run, since Puppet
currently always tries to sync ensure before any other property.
Because of this, the puppet run will fail every time, and the service
must first be managed as {ensure => stopped, enabled => true} (or
enabled => manual), before it can be managed as running and automatic
start or manual start.

Reviewed by: Jacob Helwig <jacob@puppetlabs.com>
(cherry picked from commit 82476e8be41b62ce1767ab6854a72b481b917380)

Details

Provenance
Cameron Thomas <cameron@puppetlabs.com>Authored on
Jacob Helwig <jacob@puppetlabs.com>Committed on Aug 19 2011, 10:52 PM
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUd9a693dc4431: Regexp escape substituted commands in Windows wrapper script
Branches
Unknown
Tags
Unknown

Event Timeline

Jacob Helwig <jacob@puppetlabs.com> committed rPU3be4d79d288f: Add basic service provider for Windows (authored by Cameron Thomas <cameron@puppetlabs.com>).Aug 19 2011, 10:52 PM