[OSCI] Add mamange/unmanage blocks to corosync init scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Fuel for OpenStack |
Fix Released
|
High
|
Vitaly Parakhin | ||
corosync (Ubuntu) |
Won't Fix
|
Undecided
|
Unassigned | ||
Precise |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Please add manage and unmanage fucntions to corosync init scripts' restart actions for both Centos and Ubuntu
Here is patch for centos
=======
--- corosync-
+++ corosync-
@@ -70,6 +70,50 @@
}
+pcmk_maintance() {
+ which cibadmin 1>/dev/null 2>/dev/null
+
+ if [ "${?}" -gt "0" ]; then
+ return 0
+ fi
+
+ pcmk_retry="30"
+ pcmk_maintance=
+ pcmk_sleep="1"
+
+ if [ "${pcmk_maintance}" = "" ]; then
+ pcmk_maintance=
+ fi
+
+ while [ "${pcmk_retry}" -gt "0" ]; do
+ cat <<EOF | cibadmin --patch --sync-call --xml-pipe
+
+<diff>
+ <diff-added>
+ <cib>
+ <configuration>
+ <crm_config>
+ <cluster_
+ <nvpair id="cib-
+ </cluster_
+ </crm_config>
+ </configuration>
+ </cib>
+ </diff-added>
+</diff>
+EOF
+
+ if [ "${?}" -eq "0" ]; then
+ break
+ fi
+
+ echo "Pacemaker connection failed! Retries left: ${pcmk_retry}"
+ pcmk_retry=
+ sleep "${pcmk_sleep}"
+
+ done
+}
+
cluster_
{
if grep -q nocluster /proc/cmdline && \
@@ -150,8 +194,13 @@
restart()
{
+ status $prog
+ if [ $? -eq 0 ]; then
+ pcmk_maintance true
+ fi
stop
start
+ pcmk_maintance false
}
rtrn=0
=======
And patch for ubuntu
=======
--- debian/
+++ debian.
@@ -39,6 +39,50 @@
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/
+pcmk_maintance() {
+ which cibadmin 1>/dev/null 2>/dev/null
+
+ if [ "${?}" -gt "0" ]; then
+ return 0
+ fi
+
+ pcmk_retry="30"
+ pcmk_maintance=
+ pcmk_sleep="1"
+
+ if [ "${pcmk_maintance}" = "" ]; then
+ pcmk_maintance=
+ fi
+
+ while [ "${pcmk_retry}" -gt "0" ]; do
+ cat <<EOF | cibadmin --patch --sync-call --xml-pipe
+
+<diff>
+ <diff-added>
+ <cib>
+ <configuration>
+ <crm_config>
+ <cluster_
+ <nvpair id="cib-
+ </cluster_
+ </crm_config>
+ </configuration>
+ </cib>
+ </diff-added>
+</diff>
+EOF
+
+ if [ "${?}" -eq "0" ]; then
+ break
+ fi
+
+ echo "Pacemaker connection failed! Retries left: ${pcmk_retry}"
+ pcmk_retry=
+ sleep "${pcmk_sleep}"
+
+ done
+}
+
#
# Function that starts the daemon/service
#
@@ -95,6 +139,10 @@
;;
restart|
log_daemon_msg "Restarting $DESC" "$NAME"
+ status_of_proc -p $PIDFILE $DAEMON $NAME
+ if [ $? -eq 0 ]; then
+ pcmk_maintance true
+ fi
do_stop
case "$?" in
0|1)
@@ -104,6 +152,8 @@
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
+ sleep 1
+ pcmk_maintance false
;;
*)
# Failed to stop
=======
Changed in fuel: | |
importance: | Undecided → Medium |
assignee: | nobody → Roman Vyalov (r0mikiam) |
Changed in fuel: | |
assignee: | Roman Vyalov (r0mikiam) → Fuel OSCI Team (fuel-osci) |
status: | New → Confirmed |
summary: |
- Add mamange/unmanage blocks to corosync init scripts + [OSCI] Add mamange/unmanage blocks to corosync init scripts |
Changed in fuel: | |
status: | In Progress → Fix Committed |
status: | Fix Committed → In Progress |
Changed in fuel: | |
assignee: | Fuel OSCI Team (fuel-osci) → Vitaly Parakhin (vparakhin) |
Changed in fuel: | |
importance: | Medium → High |
tags: | added: mos |
Changed in corosync (Ubuntu): | |
importance: | Undecided → High |
tags: | added: openstack |
Changed in corosync (Ubuntu): | |
status: | New → Triaged |
Changed in fuel: | |
status: | Fix Committed → Fix Released |
old request /gerrit. mirantis. com/17531 /gerrit. mirantis. com/17532
https:/
https:/