upstart_service: fallback to config files if `show-config` is not available #419

Merged
merged 3 commits into from Feb 5, 2016

Conversation

Projects
None yet
3 participants
Contributor

srenatus commented Feb 5, 2016

Fixes #417.

@srenatus srenatus added the Type: Bug label Feb 5, 2016

lib/resources/service.rb
- enabled = !config.stdout[/^\s*start on/].nil?
+ cmd = inspec.command("#{service_ctl} show-config #{service_name}")
+
+ # if initctl doesn't know `show-config`, try config file as fallback
@chris-rock

chris-rock Feb 5, 2016

Contributor

I am not 100% sure, but doesn't show-config also returns a non-zero exit code, when the service is not available. Maybe its better to check for the specific version?

srenatus added some commits Feb 5, 2016

upstart_service: add version fallback, fix regexp
before this regexp change, a service called "running" (hello integration
tests) would always be "running" ;)
Contributor

chris-rock commented Feb 5, 2016

Thanks @srenatus for this improvement

chris-rock added a commit that referenced this pull request Feb 5, 2016

Merge pull request #419 from chef/sr/fix-upstart-pre-1.3
upstart_service: fallback to config files if `show-config` is not available

@chris-rock chris-rock merged commit 5e1c9e2 into master Feb 5, 2016

2 of 3 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@chris-rock chris-rock deleted the sr/fix-upstart-pre-1.3 branch Feb 5, 2016

@chris-rock chris-rock added this to the 0.9.12 milestone Feb 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment