Merge branch '2.7rc' into 2.7.x
(#14615) Exclude helperscripts in gentoo service provider

The directory `/etc/init.d` does not only store normal initscripts but
also a few helper scripts (like `functions.sh`). The former behaviour was
to treat them as regular initscripts which can lead to dangerous results
especially when running `puppet resource service`. This command will
issue `/etc/init.d/<script> status` on every script inside
`/etc/init.d`. Because the helperscripts don't care about arguments,
this will cause the system to reboot when `/etc/init.d/reboot.sh status` is
executed.

Exclude helperscripts when searching inside `/etc/init.d`.
Update CHANGELOG, conf/redhat/puppet.spec for 2.7.15rc3
(Maint) Close filehandles after read in upstart

Not closing the filehandle after reading leaves a File object floating
around with an open handle. On unix systems this is ok, but on Windows
this causes a problem for the subsequent move of the new file into
place.

This changes to reading of a file to ensure that the file handle is
closed after we finish reading.
Merge pull request #825 from zaphod42/maint/2.7rc/leaked-filehandles-in-upstart

Maint/2.7rc/leaked filehandles in upstart
maint: Make it easier to test the service provider

Before the change the directories to search for initscripts (e.g.
`/etc/init.d`, `/sbin/init.d`) were stored in a class variable that was
calculated at load time. This way stubbing `operatingsystem` in test
cases did not change the value of `@defpath`.

Turning the class variable in a class method. This way stubbing
operatingsystem does change the result when querying defpath. The fact
lookup should be relativly cheap so we do not have to cache the
value in a class variable.
(#14615) Fix provider spec tests to work on non gentoo systems

The gentoo service provider tests made the assumption that /etc/init.d
is always the directory where the service provider will look for init
scripts while in fact the path depends on the operatingsystem.

The service provider spec also made the assumption that the sshd init
script is present on the target machine.

Stub the operatingsystem fact to prevent failures.
Stub the stat-call so the sshd script is always considered present.
Merge 'ticket/2.7.x/14615' from stschulte into 2.7rc

This blacklists some helper scripts in /etc/init.d that can, among other
things, cause the system to immediately reboot when Puppet tries to read the
status of the "reboot" script.
(#14615) Final stub fixes for the tests.

The tests assumed that they were run on a Linux, or Linux-like, system that
had ssh installed an a valid init script for it present.  This isn't true on
all our platforms, so we need to stub a little more of the outside.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>
(maint) Disable upstart spec test on windows

replace_file is disabled on windows, so the upstart spec test fails when the
provider calls out to replace_file. This commit confines the test to
non-windows platforms, where replace_file is defined.
Merge pull request #826 from haus/disable_upstart_spec_windows

Disable upstart spec windows
(#14761) Add boot, reboot to excludes list for redhat provider

On sles, the reboot init script would be triggered during a `puppet resource
service` call, which would ignore the status argument and proceed to reboot the
system. It would also call the boot init script, which could hang the puppet
call indefinitely. This commit adds both the boot and reboot services to the
redhat provider's exclude list. It also updates the redhat provider spec test
to test for those changes.
Merge pull request #827 from haus/ticket/2.7rc/14761_add_excludes_for_sles_services_to_redhat_provider

Ticket/2.7rc/14761 add excludes for sles services to redhat provider
Merge remote-tracking branch 'upstream/2.7rc' into HEAD

* upstream/2.7rc:
  (#14761) Add boot, reboot to excludes list for redhat provider
  (maint) Disable upstart spec test on windows
  (#14615) Final stub fixes for the tests.
  (#14615) Fix provider spec tests to work on non gentoo systems
  maint: Make it easier to test the service provider
  (Maint) Close filehandles after read in upstart
  Update CHANGELOG, conf/redhat/puppet.spec for 2.7.15rc3
  (#14615) Exclude helperscripts in gentoo service provider

Conflicts:
	CHANGELOG
	conf/redhat/puppet.spec
	spec/integration/provider/service/init_spec.rb
	spec/unit/provider/service/init_spec.rb

This commit undoes the restriction on the upstart spec that kept it from
running on windows. And allowed a freebsd test to begin running on 1.9
series ruby