Age | Commit message (Collapse) | Author | Files | Lines |
|
Previously, the windows service provider rescued exceptions of type
Win32::Service::Error. However, FFI-based versions of win32-service (v0.8.x)
no longer raise that type of error. Instead they raise SystemCallError.
So previously, if puppet failed to manage a service, e.g. service didn't
exist, puppet would try to rescue the exception specifying a class that
was not defined:
puppet resource service foo ensure=stopped
Error: /Service[foo]: Could not evaluate: uninitialized constant Win32::Service::Error
This regression was introduced as part of PUP-1283 when we migrated from
win32-service version 0.7.x to 0.8.x.
This commit modifies the various provider methods to more broadly rescue
StandardErrors and updates the spec tests to handle the negative cases.
Paired-with: Ethan J Brown <ethan@puppetlabs.com>
|
|
|
|
Also this patch splits out the long line in upstart_spec.rb to be
one line per service, so more diff-friendly.
|
|
|
|
(PUP-2578) Adjustments for new OpenBSD service provider
|
|
- Ensure strict ordering of the result of #pkg_scripts_append
- Add test for #in_base?
- Ensure package scripts don't end up with empty flags
|
|
The initial fix for pup-1932 inadvertently included 'static' services,
which are services which can't be enabled/disabled. Since such services
aren't manageable, it doesn't make sense to include them in instances,
so this commit removes them.
|
|
|
|
Before now, Puppet has been unable to enable services on OpenBSD.
This work implements a flags property that is manages the content of the
rc.conf.local file, used by OpenBSD to define service runtime options
and enable services.
The flags property may also be used by other platforms, such as FreeBSD.
|
|
kylog/issue/pup-1932/systemd-reports-transient-services
(PUP-1932) Restrict systemd provider to manage file-based services
|
|
Previously puppet would fail when trying to list all services because some
services require parameters for status queries to succeed. These include
idmapd-mounting and startpar-bridge. This commit adds those services to the
exclude list so that they are ignored when querying upstart for their status.
|
|
Prior to this commit, the systemd provider returned in-memory services.
This had a couple odd consequences, e.g. with 'puppet resource service':
1) short-lived services would come and go, though they are not actually
managed directly
2) disabled and stopped services wouldn't be reported at all
This commit changes the systemd provider to return file-backed
services.
|
|
Add spec examples for when a service is enabled, disabled, or
non-existent on a Suse OS.
Remove example that expected the '--check' flag for Suse, as it is no
longer passed.
|
|
pup-1766 make systemd the defaultprovider for service on rhel7
|
|
This commit allows the upstart service provider to function on Redhat
systems. Redhat 6 included support for upstart and while it wasn't
widely embraced it is available for use.
The 'serial' and 'tty' services on Redhat 6 systems have instances which
the service type/provider cannot handle, so we have to ignore them for
the upstart provider to work out of the box.
|
|
|
|
asked for
|
|
|
|
Prior to this change the systemd service provider would return
all systemd-managed types (including sockets, devices, swap, etc).
This produced a huge list of instances, many of which were not
in fact services.
This change simply adds the '--type service' option to the
'systemctl' invocation in .instances. It also updates the
spec tests with fixtures for the old (without that option)
and new (with that option) way of invoking 'systemctl'.
I purposefully did not touch the existing fixture which is
tied to a test which is pending on a what-to-do about failed
services. If/when we tackle that, we may want to collapse
some of these fixtures.
|
|
service output is no longer squelched by default.
Redmine 565, a seven year old issue referenced in a comment in lib/puppet/provider/service/service.rb, is no longer applicable to `Puppet::Util::Execution#execute`. It was squelching service output because of a bug in ruby where `#read` on a pipe never returned when the spawned process is SIGTERM'd by one of its children. The current implementation of `Puppet::Util::Execution#execute` redirects to a temporary file instead of reading from a pipe.
We should no longer be squelching service output so that users can easily diagnose service failures.
|
|
During changes a few calls had been inadvertently changed from stubs
(any number of calls allowed, including 0) to mocks (at least one call
required). In the case of the file_set this caused a problem for when
there was no expectaiton of the methods being called. In the daemontools
case, this exposed a mistake that was originally in the tests where the
stub was not even needed.
|
|
One fixed test still failing on expectations
|
|
- Replace calls to the specific :file provider with the global
Puppet.features call
|
|
- All previous File.unlink calls go through the new FileSystem::File
abstraction so that the implementation can later be swapped for a
Windows specific one to support symlinks
|
|
- All previous File and FileTest calls to exist? or exists? go through
the new FileSystem::File abstraction so that the implementation can
later be swapped for a Windows specific one to support symlinks
|
|
- All calls to File class stat / lstat go through the new
FileSystem::File abstraction so that the implementation can later
be swapped for a Windows specific one to support symlinks
|
|
- All calls to File readlink go through the new
FileSystem::File abstraction so that the implementation can later
be swapped for a Windows specific one to support symlinks
|
|
- All calls to File / FileTest class methods symlink and symlink? go
through instance methods on the new FileSystem::File abstraction so
that the implementation can later be swapped for a Windows specific
one to support symlinks
|
|
|
|
This closes GH-1883
|
|
Otherwise the path won't be found next time the provider is asked for it
|
|
|
|
* stable:
(maint) Fix Facter stubs in redhat service spec
(#20383) Provide location of duplicate resource in error
clean up docs for new parser functions
|
|
The underlying OS was leaking into this test causing issues. This makes sure
operatingsystem is stubbed, and also corrects the casing on stubbed osfamily
values.
|
|
|
|
Puppet::Util is both mixed in to Puppet::Provider and is also invoked
directly by Puppet::Util::CommandDefiner. We have to stub out the #which
method on the Provider class and the Util module because we don't know
how the method will be invoked.
|
|
|
|
* stable:
(#14615) Exclude solaris from service name acceptance test
Revert "Revert "Merge branch 'nicklewis-fix-puppet-resource-service-test' into stable""
|
|
into stable""
This reverts commit bbb1ee2418ff04dafa91534e1c3dad41c8c27bbd.
|
|
* stable:
Revert "Merge branch 'nicklewis-fix-puppet-resource-service-test' into stable"
|
|
This reverts commit f81c157f23ee637781c7bb1e384c7cb6395bcb27, reversing
changes made to 38d085c697a530192b02c2badcc4e9a73813e62d.
This change set is being reverted a second time because the acceptance
test is failing on Solaris 10 which has very different service names.
I'm reverting it because the failure represents work in progress that is
interrupting other work, even though it is a small regexp. Based on
discussion, we might simply need to open the regexp up to:
[10:21 AM] Nick Lewis: @jmccune /.*ssh.*/ perhaps, but that's getting a
little silly.
|
|
* stable:
(maint) Handle different ssh service names in `puppet resource service` test
Revert "Revert "Merge branch 'nicklewis-rcS-is-a-jerk' into stable""
closes #1620
|
|
This reverts commit dd4d41e97fe21c9bd9f628fb4f982aead04cc213.
|
|
* stable:
Revert "Merge branch 'nicklewis-rcS-is-a-jerk' into stable"
(#20308) Try again to fix fileset tests on Windows
(#20308) Fix fileset spec for Windows
|
|
This reverts commit ea548f68bac581d1d0a2e2e95738d73f658b3896, reversing
changes made to d6e6e9d51a92cba2e5dcace4b48949d1f77663b9.
Reverting because the acceptance tests is failing :(
https://jenkins.puppetlabs.com/view/Puppet%20FOSS/view/Master/job/Puppet%20Acceptance%20(master)/label=acceptance,platform=centos/767/console
|
|
* stable:
(#14615) Don't run dangerous init scripts on Debian
|
|
The init service provider has an exclude list of init scripts which
shouldn't be executed because they don't actually have a status
subcommand. However, this list was missing a couple of scripts on Debian
which also shouldn't be run: rcS and module-init-tools.
This also adds an acceptance test verifying that `puppet resource
service` doesn't change the state of the system. It does this by running
it twice and making sure the output is the same. In certain cases, this
may actually fail to identify a problem (if the init script which causes
trouble runs first, for instance), so we also verify that a known
service (ssh) is unaffected by running the command.
|
|
|
|
Per https://www.archlinux.org/news/end-of-initscripts-support/ Arch
Linux has migrated to systemd and as of January 2013 has dropped support
for sysv style init scripts. GH-1468 updated the systemctl binary
location which made the systemd service provider functional on Arch, but
since there was no clear default between init and systemd, init won out
which effectively broke systemd init scripts.
This commit sets systemd as the default for Arch Linux, and makes the
sysvinit scripts available as a fallback option. Since the init provider
is still functional and can be delegated to if there is no systemd
service for a given system service.
Squashed into a single commit and commit message update by Adrien Thebo
<adrien@puppetlabs.com>
|
|
On SuSE the `chkconfig` command needs to be passed the `--check` flag in order
to get exit codes that indicate if a service is enabled or not. Previously, we
were applying a regex to stderr but this was missing the case where the service
did not exist.
Ref: [#20121](https://projects.puppetlabs.com/issues/20121)
|