Public bug reported:

The output of crm_simulate has changed in a recent version of pacemaker
as as such the regular expressions in the service-runnable script
(bundled with booth) no longer work. In previous versions, an output
like the following would have been generated (example from pacemaker-
cli-utils version 2.0.3-3ubuntu4.3):

...
Revised cluster status:
Online: [ node1 node2 ]

 booth  (ocf::pacemaker:booth-site):    Started node1
 cluster_ip     (ocf::heartbeat:IPaddr2):       Started node1
 postgres_ip    (ocf::heartbeat:IPaddr2):       Started node2
 Clone Set: postgres_ms [postgres] (promotable)
     Masters: [ node2 ]
     Slaves: [ node1 ]


In the version bundled with Ubuntu Noble (2.1.6-5ubuntu2) the output is as 
follows:

...
Revised Cluster Status:
  * Node List:
    * Online: [ node1 node1 ]

  * Full List of Resources:
    * booth     (ocf:pacemaker:booth-site):      Started node1
    * cluster_ip        (ocf:heartbeat:IPaddr2):         Started node1
    * postgres_ip       (ocf:heartbeat:IPaddr2):         Started node2
    * Clone Set: postgres_ms [postgres] (promotable):
      * Promoted: [ node2 ]
      * Unpromoted: [ node1 ]


The patch below shows the problematic regular expression and a proposed fix 
which works against both outputs:

--- original
+++ patched
@@ -29,8 +29,8 @@
 fi
 
 if echo "$status" |
-       sed -n '/^Revised cluster status:/,$p' |
-       egrep "^[[:space:]]+${service}[[:space:]]+\(.*\):[[:space:]]+Started 
([^[:space:]]+) *$" >/dev/null
+       sed -n '/^Revised cluster status:/I,$p' |
+       egrep "^[[:space:]*]+${service}[[:space:]]+\(.*\):[[:space:]]+Started 
([^[:space:]]+) *$" >/dev/null
 then
        # can be started - we're done.
        exit 0

This makes the header match case insensitive and allows for the *
character to precede the resource name.

Additional information:
* OS Release: Ubuntu 24.04
* Package Version: 1.1-1ubuntu4

** Affects: booth (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  The output of crm_simulate has changed in a recent version of pacemaker
  as as such the regular expressions in the service-runnable script
  (bundled with booth) no longer work. In previous versions, an output
  like the following would have been generated (example from pacemaker-
  cli-utils version 2.0.3-3ubuntu4.3):
  
  ...
  Revised cluster status:
  Online: [ node1 node2 ]
  
   booth        (ocf::pacemaker:booth-site):    Started node1
   cluster_ip   (ocf::heartbeat:IPaddr2):       Started node1
   postgres_ip  (ocf::heartbeat:IPaddr2):       Started node2
   Clone Set: postgres_ms [postgres] (promotable)
       Masters: [ node2 ]
       Slaves: [ node1 ]
  
  
  In the version bundled with Ubuntu Noble (2.1.6-5ubuntu2) the output is as 
follows:
  
  ...
  Revised Cluster Status:
    * Node List:
      * Online: [ node1 node1 ]
  
    * Full List of Resources:
      * booth   (ocf:pacemaker:booth-site):      Started node1
      * cluster_ip      (ocf:heartbeat:IPaddr2):         Started node1
-     * postgresql_ip   (ocf:heartbeat:IPaddr2):         Started node2
-     * Clone Set: postgresql_ms [postgresql] (promotable):
+     * postgres_ip     (ocf:heartbeat:IPaddr2):         Started node2
+     * Clone Set: postgres_ms [postgres] (promotable):
        * Promoted: [ node2 ]
        * Unpromoted: [ node1 ]
  
  
  The patch below shows the problematic regular expression and a proposed fix 
which works against both outputs:
  
  --- original
  +++ patched
  @@ -29,8 +29,8 @@
   fi
   
   if echo "$status" |
  -     sed -n '/^Revised cluster status:/,$p' |
  -     egrep "^[[:space:]]+${service}[[:space:]]+\(.*\):[[:space:]]+Started 
([^[:space:]]+) *$" >/dev/null
  +     sed -n '/^Revised cluster status:/I,$p' |
  +     egrep "^[[:space:]*]+${service}[[:space:]]+\(.*\):[[:space:]]+Started 
([^[:space:]]+) *$" >/dev/null
   then
        # can be started - we're done.
        exit 0
  
  This makes the header match case insensitive and allows for the *
  character to precede the resource name.
  
  Additional information:
  * OS Release: Ubuntu 24.04
  * Package Version: 1.1-1ubuntu4

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2123817

Title:
  service-runnable doesn't work with pacemaker version

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/booth/+bug/2123817/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to