Thank you for taking the time to report this bug. In an effort to keep an
up-to-date and valid list of bugs to work on, I have reviewed this report
to verify it still requires effort and occurs on an Ubuntu release in
standard support, and it does not.

Unfortunately this bug is old for us to consider having an sysv-compatible
option to put the cluster into maintenance mode. Corosync is also being managed,
for sometime now, by systemd so this particular change wouldn't make much sense.
IMHO this type of cluster change should be done by the cluster administrator in
specific tools like crmsh, pcs, and not in an init script.

It is unfortunate that we were unable to resolve this defect, however
there appears to be no further action possible at this time. I am
therefore moving the bug to 'Incomplete'. If you disagree or have
new information, we would be grateful if you could please add a comment 
stating why and then change the status of the bug to 'New'.


** Also affects: corosync (Ubuntu Precise)
   Importance: Undecided
       Status: New

** Changed in: corosync (Ubuntu Precise)
       Status: New => Incomplete

** Changed in: corosync (Ubuntu)
       Status: Triaged => Won't Fix

** Changed in: corosync (Ubuntu)
     Assignee: Rafael David Tinoco (rafaeldtinoco) => (unassigned)

** Changed in: corosync (Ubuntu Precise)
       Status: Incomplete => Won't Fix

** Changed in: corosync (Ubuntu)
   Importance: High => Undecided

-- 
You received this bug notification because you are a member of Ubuntu
High Availability Team, which is subscribed to corosync in Ubuntu.
https://bugs.launchpad.net/bugs/1340172

Title:
  [OSCI] Add mamange/unmanage blocks to corosync init scripts

Status in Fuel for OpenStack:
  Fix Released
Status in corosync package in Ubuntu:
  Won't Fix
Status in corosync source package in Precise:
  Won't Fix

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-1.4.6/init/generic.in    2013-05-29 18:33:27.000000000 +0400
  +++ corosync-1.4.6.new/init/generic.in        2014-07-10 16:34:27.127641857 
+0400
  @@ -70,6 +70,50 @@
                   pidof -c -o $$ -o $PPID -o %PPID "${1##*/}"
   }
   
  +pcmk_maintance() {
  +  which cibadmin 1>/dev/null 2>/dev/null
  +
  +  if [ "${?}" -gt "0" ]; then
  +    return 0
  +  fi
  +
  +  pcmk_retry="30"
  +  pcmk_maintance="${1}"
  +  pcmk_sleep="1"
  +
  +  if [ "${pcmk_maintance}" = "" ]; then
  +    pcmk_maintance="true"
  +  fi
  +
  +  while [ "${pcmk_retry}" -gt "0" ]; do
  +    cat <<EOF | cibadmin --patch --sync-call --xml-pipe
  +
  +<diff>
  +  <diff-added>
  +    <cib>
  +      <configuration>
  +        <crm_config>
  +          <cluster_property_set id="cib-bootstrap-options">
  +            <nvpair id="cib-bootstrap-options-maintenance-mode" 
name="maintenance-mode" value="${pcmk_maintance}"/>
  +          </cluster_property_set>
  +        </crm_config>
  +      </configuration>
  +    </cib>
  +  </diff-added>
  +</diff>
  +EOF
  +
  +    if [ "${?}" -eq "0" ]; then
  +      break
  +    fi
  +
  +    echo "Pacemaker connection failed! Retries left: ${pcmk_retry}"
  +    pcmk_retry="$((pcmk_retry - 1))"
  +    sleep "${pcmk_sleep}"
  +
  +  done
  +}
  +
   cluster_disabled_at_boot()
   {
          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/corosync.init      2011-08-24 11:27:27.000000000 +0400
  +++ debian.new/corosync.init  2014-07-10 16:47:12.823624121 +0400
  @@ -39,6 +39,50 @@
   # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
   . /lib/lsb/init-functions
   
  +pcmk_maintance() {
  +  which cibadmin 1>/dev/null 2>/dev/null
  +
  +  if [ "${?}" -gt "0" ]; then
  +    return 0
  +  fi
  +
  +  pcmk_retry="30"
  +  pcmk_maintance="${1}"
  +  pcmk_sleep="1"
  +
  +  if [ "${pcmk_maintance}" = "" ]; then
  +    pcmk_maintance="true"
  +  fi
  +
  +  while [ "${pcmk_retry}" -gt "0" ]; do
  +    cat <<EOF | cibadmin --patch --sync-call --xml-pipe
  +
  +<diff>
  +  <diff-added>
  +    <cib>
  +      <configuration>
  +        <crm_config>
  +          <cluster_property_set id="cib-bootstrap-options">
  +            <nvpair id="cib-bootstrap-options-maintenance-mode" 
name="maintenance-mode" value="${pcmk_maintance}"/>
  +          </cluster_property_set>
  +        </crm_config>
  +      </configuration>
  +    </cib>
  +  </diff-added>
  +</diff>
  +EOF
  +
  +    if [ "${?}" -eq "0" ]; then
  +      break
  +    fi
  +
  +    echo "Pacemaker connection failed! Retries left: ${pcmk_retry}"
  +    pcmk_retry="$((pcmk_retry - 1))"
  +    sleep "${pcmk_sleep}"
  +
  +  done
  +}
  +
   #
   # Function that starts the daemon/service
   #
  @@ -95,6 +139,10 @@
        ;;
     restart|force-reload)
        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
  =======================================================

To manage notifications about this bug go to:
https://bugs.launchpad.net/fuel/+bug/1340172/+subscriptions

_______________________________________________
Mailing list: https://launchpad.net/~ubuntu-ha
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~ubuntu-ha
More help   : https://help.launchpad.net/ListHelp

Reply via email to