Merge lp:~james-page/charm-helpers/refactor-service-control into lp:charm-helpers
Proposed by
James Page
Status: | Merged |
---|---|
Merged at revision: | 32 |
Proposed branch: | lp:~james-page/charm-helpers/refactor-service-control |
Merge into: | lp:charm-helpers |
Diff against target: |
196 lines (+62/-71) 3 files modified
charmhelpers/core/host.py (+11/-9) tests/contrib/charmsupport/test_nrpe.py (+4/-4) tests/core/test_host.py (+47/-58) |
To merge this branch: | bzr merge lp:~james-page/charm-helpers/refactor-service-control |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthew Wedgwood (community) | Approve | ||
James Page | Needs Resubmitting | ||
Review via email: mp+170383@code.launchpad.net |
Description of the change
Refactoring of service control code in host helper
1) Use 'service' command for all service control
Detecting upstart and init.d configuration files is overkill; this is
exactly what the 'service' command is design todo and it also deals with
saucy onwards where init.d and upstart configuration with the same
name might be installed.
'service' will always do the right thing
2) Added restart and reload helpers
reload detects an error (say the service is not running) and will fallback
to restart if so.
This is inline with the openstack charm helpers code.
To post a comment you must log in.
For service_reload, I don't think it's safe to assume that a service should be restarted if reload fails. I'm at a loss to find an example, but services whose "reload" commands handle invalid configuration gracefully might be brought down on a "restart."