nailgun-agent: use service command to restart mcollective

mcollectived can be launched via upstart job or systemd unit.
Fortunately the service command hides those gory details.

Change-Id: Iad4c8bc5d89176513b4d3bcc37a4161a9d900caf
Related-Bug: #1454741
This commit is contained in:
Alexei Sheplyakov 2015-05-27 17:33:38 +03:00
parent 381eef2de5
commit 03cddb0c23
1 changed files with 1 additions and 5 deletions

6
agent
View File

@ -109,11 +109,7 @@ class McollectiveConfig
@logger.info "Identity in mcollective server.cfg has not been found. Setting to '#{new_id}'"
File.open(@configfile, "w") { |f| f.write(config) }
end
# Generally because generic init script for
# mcollective is broken at least in Ubuntu and
# altering restart in such way seems better
# than shipping our own package.
puts `/etc/init.d/mcollective stop; /etc/init.d/mcollective start`
puts `service mcollective restart`
end
end
end