Fix monitor/stop operations for the rabbit OCF resource
Fix monitor/stop operations for the rabbit OCF resource

W/o this fix, the situation is possible when:
- beam's running and cannot process signals, but is reported "not running"
by the get_status(), while in fact it shall be reported as generic error
- which_applications() returned error, while its output is still
being parsed for the "what" match, while it shall not.
- action stop and proc_stop gives up then there is no pidfile and the beam's
running unresponsive.

The solution is to make get_status to return generic error and action
stop to use the rabbit process name matching for killing it. These and
other related fixes listed below (tl;dr)

* Fix get_status, action_stop, proc_stop then beam's unresponsive
  (ie. fails to process signals or does it very slowly)
  - Fix get status() to catch beam state and output errors
  - Fix action_stop() to force name-based mathcing then no
    pidfile and the beam's unresponsive
  - Fix proc_stop to use name based matching if no pidfile
    found
  - Fix proc_stop to retry sending the signal when using the name
    based match as well
* Fix the get_status() unexpectedly reports generic error
  instead of "not running"
* Add reworked proc_stop and proc_kill functions from the
  ocf-fuel-funcs
* Rework stop_server_process()
  - make it to return SUCCESS/ERROR as expected
  - grant the "rabbitmqctl stop" a graceful termintation window and only
    then ensure the beam process termination and pidfile removal as well
  - return the actual status with get_status()
* Rework kill_rmq_and_remove_pid()
  - use proc_stop to try to kill by pgrp with -TERM, then -KILL, or
    by the beam process name match, if there is no PID.
  - make it to returns SUCCESS/ERROR
* Fix action_stop()
  - fail early by the stop_server_process() results without additional
    rabbitmqctl invocations in the get_status() call
  - rework hard-coded sleep 10 to use the gracefull stop windows in the
    stop_server_process() instead
  - ensure the rabbit-start-time removal from CIB before to try to stop
    the server process
  - issue the "stop: action end" log record before the actual end
* Add comments, adjust logs levels and make them to be more informational

Upstream PRs
https://github.com/rabbitmq/rabbitmq-server/pull/523
https://github.com/rabbitmq/rabbitmq-server/pull/532
https://github.com/rabbitmq/rabbitmq-server/pull/538
https://github.com/rabbitmq/rabbitmq-server/pull/540

Closes-bug: #1529897

Change-Id: I1c382e3cf004630847b6626fabaecaa0094ee271
Signed-off-by: Bogdan Dobrelya <0b23cd1e586d5f091fecb3391314c2b9ec1fd641@mirantis.com>

stackforge/fuel-library,xarses/fuel-library,xarses/fuel-library,xarses/fuel-library,stackforge/fuel-library,stackforge/fuel-library,stackforge/fuel-library,xarses/fuel-library