Fix sys V init script so start/restart actions work properly 60/6760/4
authorAlexei Sheplyakov <asheplyakov@mirantis.com>
Sat, 16 May 2015 10:24:33 +0000 (13:24 +0300)
committerAlexei Sheplyakov <asheplyakov@mirantis.com>
Tue, 19 May 2015 19:06:53 +0000 (22:06 +0300)
commit176926bf9e3ff5de2ad044776820c064b933b80c
tree82197afaabdda049f1a266dbb88a9b76d107ded5
parentdb947230a760831d7baf83668989f47d882312c1
Fix sys V init script so start/restart actions work properly

The config file shipped with the package tells mcollectived to daemonize.
However the init script assumes mcollectived runs in the foreground
(start-stop-daemon -b) and tells start-stop-daemon put mcollective into
background and to manage the pid file. So start-stop-daemon forks, records
its pid, and starts mcollective which forks again. Therefore PID recorded
in the PID file is wrong. As a result the restart action spawns a new
instance of mcollective without stopping the old one, and start launches
a new mcollective even if it's already running.

Rewrite the init script, drop the trickery which start-stop-daemon does
on its own (provided that PID file is correct). While at it add dependency
on ruby-stomp (mcollectived won't even start without it).

Closes-Bug: #1454741
Change-Id: Iac4d3535c98881be7ccea256c50d58f337420205
debian/changelog
debian/control
debian/mcollective.default [new file with mode: 0644]
debian/mcollective.init
mcollective.init