Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add service overrides for picking specific service managers, add runit_service #380

Merged
merged 10 commits into from
Jan 21, 2016

Conversation

srenatus
Copy link
Contributor

The changes to lib/resource/service.rb have gotten a little bigger. The handling of service_ctl still feels a little awkward, so when you review this, please keep your eyes open for further possible simplifications.

The problem is that when you use runit_service('name', '/path/to/sv'), the latter needs to be passed to the underlying ServiceManager, and thus both Service and ServiceManager need the optional argument in their constructors.

I've added integration tests installing runit on centos.

Fixes #242.

TODO: Documentation -- so, currently, docs/resources.rst has to be updated manually?

NB I've just added default duplicates to one instance (i.e., there's
only one `systemd_service`), since there's no os-specific magic in them.
Also these tests only verify that the default choice is equivalent to
`service` on the tested distribution.
I've recovered the debian/centos special handling of the `service`
binary, although I doubt that it's necessary.
@srenatus srenatus added the Type: Enhancement Improves an existing feature label Jan 21, 2016
cmd = inspec.command("#{service_cmd} #{service_name} status")
cmd.exit_status == 0 ? (running = true) : (running = false)
cmd = inspec.command("#{service_ctl} #{service_name} status")
running = cmd.exit_status == 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chris-rock
Copy link
Contributor

awesome job @srenatus

chris-rock added a commit that referenced this pull request Jan 21, 2016
add service overrides for picking specific service managers, add runit_service
@chris-rock chris-rock merged commit b30720f into master Jan 21, 2016
@chris-rock chris-rock deleted the sr/service-override branch January 21, 2016 12:35
@chris-rock chris-rock added this to the 0.9.10 milestone Jan 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Improves an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants