Hello community,

here is the log from the commit of package resource-agents for openSUSE:Factory 
checked in at 2011-12-25 17:52:18
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/resource-agents (Old)
 and      /work/SRC/openSUSE:Factory/.resource-agents.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "resource-agents", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/resource-agents/resource-agents.changes  
2011-09-23 12:44:14.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.resource-agents.new/resource-agents.changes     
2011-12-25 17:52:20.000000000 +0100
@@ -1,0 +2,79 @@
+Thu Dec 15 08:17:33 UTC 2011 - [email protected]
+
+- Add /usr/lib/tmpfiles.d/resource-agents.conf to ensure temp dir
+  exists when using systemd (bnc#734760)
+
+-------------------------------------------------------------------
+Mon Dec 12 13:37:37 UTC 2011 - [email protected]
+
+- varnish: new resource agent
+- LVM: force dmevent monitoring for clones
+- Filesystem: repair the fast_stop parameter use (its value has
+  always been false)
+- slapd: prevent possible timeout in stop (wrong logic in stop)
+- upstream cs: 72fdc8
+
+-------------------------------------------------------------------
+Fri Nov 25 12:25:57 UTC 2011 - [email protected]
+
+- asterisk: new resource agent
+- IPaddr: add back the local_start/stop_script code
+- iscsi: proceed if iscsid is not running if iscsid.startup is
+  present in iscsid.conf
+- mysql: check mysql status more thoroughly before stopping
+- jboss: add the java_opts parameter for java options
+- VirtualDomain: add a functionality that modifies utilization of
+  resource automatically
+- Tools: ocft: new option Agent, corresponding configs update
+- doc: Add RA developer's guide
+- move NodeUtilization to Pacemaker
+- upstream cs: 1f8f3d
+
+-------------------------------------------------------------------
+Fri Nov 18 10:54:10 UTC 2011 - [email protected]
+
+- Implemetation of Dynamic utilization detection and setting.
+  Based on FATE#310117 and FATE#310115.
+
+-------------------------------------------------------------------
+Tue Nov  8 08:35:28 UTC 2011 - [email protected]
+
+- cleanup sfex_uuid.patch 
+
+-------------------------------------------------------------------
+Mon Nov  7 14:43:09 UTC 2011 - [email protected]
+
+- tomcat: remove pidfile before start, it may prevent some tomcat
+  releases from starting
+- ocft: new options variable and cleanup-agent, var/unvar renamed
+  to env/unenv, corresponding configs update
+- upstream cs: 5599aa
+
+-------------------------------------------------------------------
+Mon Oct 31 09:41:38 UTC 2011 - [email protected]
+
+- fate#311000, sfex_daemon accept "-u $uuid". When assiging $uuid
+  as a parameter, $lock_index is ignored.
+
+-------------------------------------------------------------------
+Mon Oct 24 13:40:47 UTC 2011 - [email protected]
+
+- slapd: wait in start for the service to come up
+- apache: fix sysconfig includes & enable status for default SUSE conf
+- upstream cs: 80b640
+
+-------------------------------------------------------------------
+Mon Oct 10 13:39:35 UTC 2011 - [email protected]
+
+- named: new resource agent
+- Tools: send_arp.libnet: fix for big endian platforms (bnc#721334)
+- rsyslog: new RA to manage rsyslog servers
+- slapd: new RA to manage OpenLDAP servers
+- Xen: wait in migrate_from for the migration to finish instead
+  of bailing out immediately
+- conntrackd: test for socket existence in monitor instead of
+  process grep
+- postfix: multiple fixes and improvements
+- upstream cs: 6c24ae
+
+-------------------------------------------------------------------

Old:
----
  0001-Build-Add-a-new-agent-NodeUtilization.patch
  0001-Low-VirtualDomain-Add-a-functionality-that-modifies.patch
  ctdb-bnc-696978-01-add-smb_fileid_algorithm.patch
  ctdb-bnc-712192-monitor-status.patch
  ctdb-bnc-712410-default-enabled.patch

New:
----
  resource-agents.conf
  sfex_uuid.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ resource-agents.spec ++++++
--- /var/tmp/diff_new_pack.8ZnNyV/_old  2011-12-25 17:52:21.000000000 +0100
+++ /var/tmp/diff_new_pack.8ZnNyV/_new  2011-12-25 17:52:21.000000000 +0100
@@ -38,26 +38,26 @@
 
 Name:           resource-agents
 Summary:        The Heartbeat Subsystem for High-Availability Linux
+License:        GPL-2.0 ; LGPL-2.1+
+Group:          Productivity/Clustering/HA
 Version:        3.9.2
 Release:        0
-License:        GPL-2.0 ; LGPL-2.1+
 Url:            http://linux-ha.org/
-Group:          Productivity/Clustering/HA
 Source:         resource-agents-%{version}.tar.bz2
+Source1:        resource-agents.conf
 Patch1:         resource-agents-mysql-sle11.patch
 Patch2:         lvm-vg-partial-active.diff
 Patch3:         resource-agents-nfsserver-sle11.patch
 Patch4:         no-var-lock-subsys.patch
-Patch6:         0001-Build-Add-a-new-agent-NodeUtilization.patch
-Patch7:         0001-Low-VirtualDomain-Add-a-functionality-that-modifies.patch
-Patch8:         ctdb-bnc-696978-01-add-smb_fileid_algorithm.patch
-Patch10:        ctdb-bnc-712410-default-enabled.patch
-Patch11:        ctdb-bnc-712192-monitor-status.patch
+Patch9:         sfex_uuid.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-AutoReqProv:    on
 Obsoletes:      heartbeat-resources
 Provides:       heartbeat-resources
-BuildRequires:  autoconf automake glib2-devel pkgconfig python-devel
+BuildRequires:  autoconf
+BuildRequires:  automake
+BuildRequires:  glib2-devel
+BuildRequires:  pkgconfig
+BuildRequires:  python-devel
 %if 0%{?suse_version}  
 BuildRequires:  libglue-devel
 %if %suse_version > 1130
@@ -65,11 +65,16 @@
 %else
 BuildRequires:  libnet
 %endif
-BuildRequires:  docbook-xsl-stylesheets docbook_4 libxslt
+BuildRequires:  docbook-xsl-stylesheets
+BuildRequires:  docbook_4
+BuildRequires:  libxslt
 %endif
 %if 0%{?fedora} || 0%{?centos_version} || 0%{?rhel}
-BuildRequires:  cluster-glue-libs-devel which
-BuildRequires:  docbook-dtds docbook-style-xsl libxslt
+BuildRequires:  cluster-glue-libs-devel
+BuildRequires:  which
+BuildRequires:  docbook-dtds
+BuildRequires:  docbook-style-xsl
+BuildRequires:  libxslt
 %endif
 
 %description
@@ -108,9 +113,7 @@
     (See doc/AUTHORS)
 
 %package -n ldirectord
-License:        GPL-2.0 ; LGPL-2.1+
 Summary:        The Heartbeat Subsystem for High-Availability Linux
-Group:          Productivity/Clustering/HA
 Requires:       %{SSLeay} perl-libwww-perl ipvsadm
 Obsoletes:      heartbeat-ldirectord
 Provides:       heartbeat-ldirectord
@@ -165,11 +168,7 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
-%patch10 -p1
-%patch11 -p1
+%patch9 -p1
 ###########################################################
 
 %build
@@ -212,7 +211,8 @@
 find $RPM_BUILD_ROOT -name '*.dtd'  -type f -print0 | xargs -0 chmod a-x
 chmod 0755 $RPM_BUILD_ROOT/usr/sbin/ocf-tester
 chmod 0755 $RPM_BUILD_ROOT/usr/sbin/ocft
-
+mkdir -p $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
+install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/usr/lib/tmpfiles.d
 (
 cd $RPM_BUILD_ROOT/%{_libdir}/heartbeat
 for f in ocf-returncodes ocf-shellfuncs
@@ -231,6 +231,9 @@
 fi
 rm -rf $RPM_BUILD_DIR/resource-agents
 ###########################################################
+%post
+test -d /var/run/resource-agents || mkdir -m 1755 /var/run/resource-agents
+
 %if 0%{?suse_version}
 
 %preun -n ldirectord
@@ -256,6 +259,8 @@
 %dir /usr/lib/ocf
 %dir /usr/lib/ocf/resource.d
 %dir /usr/lib/ocf/lib
+%dir /usr/lib/tmpfiles.d
+/usr/lib/tmpfiles.d/resource-agents.conf
 %dir %{_datadir}/%{name}
 %dir %{_datadir}/%{name}/ocft
 %dir %{_datadir}/%{name}/ocft/configs

++++++ lvm-vg-partial-active.diff ++++++
--- /var/tmp/diff_new_pack.8ZnNyV/_old  2011-12-25 17:52:21.000000000 +0100
+++ /var/tmp/diff_new_pack.8ZnNyV/_new  2011-12-25 17:52:21.000000000 +0100
@@ -14,17 +14,20 @@
  </parameter>
  
  </parameters>
-@@ -211,9 +211,9 @@ LVM_start() {
-   if ocf_is_true "$OCF_RESKEY_exclusive" ; then
-       active_mode="ey"
-   fi  
--  partial_active=""
+@@ -224,7 +224,7 @@ LVM_start() {
+   fi
+   vgchange_options="-a $active_mode"
+ 
 -  if ocf_is_true "$OCF_RESKEY_partial_activation" ; then
--      partial_active="--partial"
-+  partial_active="--partial"
-+  if ! ocf_is_true "$OCF_RESKEY_partial_activation" ; then
-+      partial_active=""
++  if ocf_is_true "$PARTIAL_INVOCATION" ; then
+       vgchange_options="$vgchange_options --partial"
    fi
  
-   ocf_run vgchange -a $active_mode $partial_active $1 || return 
$OCF_ERR_GENERIC
- 
\ No newline at end of file
+@@ -357,6 +357,7 @@ then
+ fi
+ LVM_MAJOR="${LVM_VERSION%%.*}"
+ 
++PARTIAL_INVOCATION=${OCF_RESKEY_partial_activation:-"true"}
+ VOLUME=$OCF_RESKEY_volgrpname
+ OP_METHOD=$1
+ # What kind of method was invoked?

++++++ resource-agents-3.9.2.tar.bz2 ++++++
++++ 10719 lines of diff (skipped)

++++++ resource-agents.conf ++++++
d /var/run/resource-agents 1755 root root
++++++ sfex_uuid.patch ++++++
Index: resource-agents/tools/sfex.h
===================================================================
--- resource-agents.orig/tools/sfex.h   2011-10-31 17:40:17.000000000 +0800
+++ resource-agents/tools/sfex.h        2011-10-31 17:40:55.000000000 +0800
@@ -88,8 +88,8 @@
  * (In the Linux kernel 2.6, if this value is not 512 multibles, direct I/O 
  * does not work)
  
- * number of locks  --- 4 bytes. This is printable integer number and range 
- * is from 1 to 999. This must be left-justify, null(0x00) padding, and make 
+ * number of locks  --- 8 bytes. This is printable integer number and range
+ * is from 1 to 9999. This must be left-justify, null(0x00) padding, and make
  * a last byte null. This is the number of locks following this control data.
  *
  * padding --- The size of this member depend on blocksize. It is adjusted so 
@@ -101,7 +101,7 @@
   int version;                 /*  version number */
   int revision;                        /*  revision number */
   size_t blocksize;            /*  block size */
-  int numlocks;                        /*  number of locks */
+  unsigned long numlocks;                      /*  number of locks */
 } sfex_controldata;
 
 typedef struct sfex_controldata_ondisk {
@@ -109,7 +109,7 @@
   uint8_t version[4];
   uint8_t revision[4];
   uint8_t blocksize[8];
-  uint8_t numlocks[4];
+  uint8_t numlocks[8];
 } sfex_controldata_ondisk;
 
 /*
@@ -145,12 +145,14 @@
   char status;                         /* status of lock */
   int count;                           /* increment counter */
   char nodename[256];          /* node name */
+  char uuid[36];
 } sfex_lockdata;
 
 typedef struct sfex_lockdata_ondisk {
        uint8_t status;
        uint8_t count[4];
        uint8_t nodename[256];
+       uint8_t uuid[37];
 } sfex_lockdata_ondisk;
 
 /* character for lock status. This is used in sfex_lockdata.status */
@@ -160,7 +162,7 @@
 /* features of each member of control data and lock data */
 #define SFEX_MAGIC "SFEX"
 #define SFEX_MIN_NUMLOCKS 1
-#define SFEX_MAX_NUMLOCKS 999
+#define SFEX_MAX_NUMLOCKS 9999
 #define SFEX_MIN_COUNT 0
 #define SFEX_MAX_COUNT 999
 #define SFEX_MAX_NODENAME (sizeof(((sfex_lockdata *)0)->nodename) - 1)
Index: resource-agents/tools/sfex_daemon.c
===================================================================
--- resource-agents.orig/tools/sfex_daemon.c    2011-10-31 17:40:14.000000000 
+0800
+++ resource-agents/tools/sfex_daemon.c 2011-11-08 11:58:43.000000000 +0800
@@ -10,6 +10,7 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <linux/types.h>
 #include <fcntl.h>
 #include <syslog.h>
 #include "sfex.h"
@@ -39,28 +40,128 @@
          fprintf(dist, "usage: %s [-i <index>] [-c <collision_timeout>] [-t 
<lock_timeout>] <device>\n", progname);
 }
 
-static void acquire_lock(void)
+static void check_lock(void)
 {
        if (read_lockdata(&cdata, &ldata, lock_index) == -1) {
                cl_log(LOG_ERR, "read_lockdata failed in acquire_lock\n");
                exit(EXIT_FAILURE);
        }
+       if (ldata.status == SFEX_STATUS_LOCK) {
+               printf("host=%s, uuid=%s\n",
+                               (const char*)(ldata.nodename),
+                               (const char*)(ldata.uuid));
+       } else {
+               printf("\n");
+       }
+}
+
+/* 0 -> false, 1 -> true */
+static inline int is_used_by_uuid(const char* uuid)
+{
+       if (read_lockdata(&cdata, &ldata, lock_index) == -1) {
+               cl_log(LOG_ERR, "read_lockdata failed in acquire_lock\n");
+               exit(EXIT_FAILURE);
+       }
+       return !(strncmp(uuid, ldata.uuid, sizeof(ldata.uuid)));
+}
 
-       if ((ldata.status == SFEX_STATUS_LOCK) && (strncmp(nodename, (const 
char*)(ldata.nodename), sizeof(ldata.nodename)))) {
+/* 0 -> unlocked, 1 -> locked */
+static inline int is_locked(void)
+{
+       if (read_lockdata(&cdata, &ldata, lock_index) == -1) {
+               cl_log(LOG_ERR, "read_lockdata failed in acquire_lock\n");
+               exit(EXIT_FAILURE);
+       }
+
+       if (ldata.status == SFEX_STATUS_LOCK) {
                unsigned int t = lock_timeout;
-               while (t > 0)
-                       t = sleep(t);
+               while (t > 0) t = sleep(t);
                read_lockdata(&cdata, &ldata_new, lock_index);
                if (ldata.count != ldata_new.count) {
-                       cl_log(LOG_ERR, "can\'t acquire lock: the lock's 
already hold by some other node.\n");
+                       return 1;
+               } else {
+                       return 0;
+               }
+       }
+       return 0;
+}
+
+#define SFEX_BULK_SIZE 10
+
+/* SBDMhash */
+static inline unsigned int uuid2int(const char *str)
+{
+       unsigned int hash = 0;
+
+       while (*str)
+       {
+               if (*str == '-') { str++; continue;}
+               /* equivalent to: hash = 65599*hash + (*str++); */
+               hash = (*str++) + (hash << 6) + (hash << 16) - hash;
+       }
+
+       return (((hash & 0x7FFFFFFF) % 
SFEX_MAX_NUMLOCKS)/SFEX_BULK_SIZE)*SFEX_BULK_SIZE;
+}
+
+static inline void search_for_uuid(const char* uuid, unsigned int 
lock_index_limit)
+{
+       unsigned int old_lock_index;
+       old_lock_index = lock_index;
+       while (lock_index < lock_index_limit) {
+               if (is_used_by_uuid(uuid)) return;
+               else lock_index++;
+       }
+       lock_index = old_lock_index;
+}
+
+static void acquire_lock(const char* uuid)
+{
+
+       unsigned int lock_index_limit = 0;
+/*     unsigned int old_lock_index = lock_index; */
+       if (uuid) {
+               if (cdata.numlocks < 9999) {
+                       cl_log(LOG_ERR, "must have at least 9999 lock slots to 
use uuid based lock.\n");
                        exit(2);
                }
+               lock_index = uuid2int(uuid);
+               lock_index_limit = lock_index + SFEX_BULK_SIZE;
+               search_for_uuid(uuid, lock_index_limit);
+       } else {
+               lock_index_limit = lock_index + 1;
+       }
+
+       while (lock_index < lock_index_limit) {
+               cl_log(LOG_INFO, "Try lock_index = %d\n", lock_index);
+               if (is_locked()) {
+                       if (strncmp(uuid, (const char*)(ldata.uuid), 
sizeof(ldata.uuid))) {
+                               cl_log(LOG_INFO, "can\'t acquire lock: the lock 
is used for other uuid.\n");
+                               lock_index = lock_index + 1;
+                               continue;
+                       }
+                       if (strncmp(nodename, (const char*)(ldata.nodename), 
sizeof(ldata.nodename))) {
+                               cl_log(LOG_ERR, "can\'t acquire lock: the lock 
is already held by other node.\n");
+                               exit(2);
+                       } else {
+                               cl_log(LOG_ERR, "this lock is already held by 
me\n");
+                               exit(2);
+                       }
+               } else {
+                       break;
+               }
        }
 
+       if (lock_index == lock_index_limit) { /* we have run out of bulk */
+               cl_log(LOG_ERR, "can\'t find free lock slot to hold this 
uuid.\n");
+               exit(2);
+       }
+
+       /* from now on, we have a unlocked lock slot */
        /* The lock acquisition is possible because it was not updated. */
        ldata.status = SFEX_STATUS_LOCK;
        ldata.count = SFEX_NEXT_COUNT(ldata.count);
        strncpy((char*)(ldata.nodename), nodename, sizeof(ldata.nodename));
+       strncpy((char*)(ldata.uuid), uuid, sizeof(ldata.uuid));
        if (write_lockdata(&cdata, &ldata, lock_index) == -1) {
                cl_log(LOG_ERR, "write_lockdata failed\n");
                exit(EXIT_FAILURE);
@@ -81,7 +182,11 @@
                        cl_log(LOG_ERR, "read_lockdata failed in collision 
detection\n");
                }
                if (strncmp((char*)(ldata.nodename), (const 
char*)(ldata_new.nodename), sizeof(ldata.nodename))) {
-                       cl_log(LOG_ERR, "can\'t acquire lock: collision 
detected in the air.\n");
+                       cl_log(LOG_ERR, "can\'t acquire lock: nodename 
collision detected in the air.\n");
+                       exit(2);
+               }
+               if (strncmp((char*)(ldata.uuid), (const char*)(ldata_new.uuid), 
sizeof(ldata.uuid))) {
+                       cl_log(LOG_ERR, "can\'t acquire lock: uuid collision 
detected in the air.\n");
                        exit(2);
                }
        }
@@ -190,6 +295,8 @@
 {      
 
        int ret;
+       int check_status = 0;
+       char *uuid = NULL;
 
        progname = get_progname(argv[0]);
        nodename = get_nodename();
@@ -201,13 +308,16 @@
        /* read command line option */
        opterr = 0;
        while (1) {
-               int c = getopt(argc, argv, "hi:c:t:m:n:r:");
+               int c = getopt(argc, argv, "shi:u:c:t:m:n:r:");
                if (c == -1)
                        break;
                switch (c) {
                        case 'h':           /* help*/
                                usage(stdout);
                                exit(EXIT_SUCCESS);
+                       case 's':           /* status */
+                               check_status = 1;
+                               break;
                        case 'i':           /* -i <index> */
                                {
                                        unsigned long l = strtoul(optarg, NULL, 
10);
@@ -281,6 +391,17 @@
                                        rsc_id = strdup(optarg);
                                }
                                break;
+                       case 'u':
+                               {
+                                       uuid = strdup(optarg);
+                                       if (strlen(uuid) > 36) {
+                                               cl_log(LOG_ERR, "uuid %s is too 
long. must be less than 36 byte.\n",
+                                                               uuid);
+                                               exit(EXIT_FAILURE);
+                                       }
+
+                               }
+                               break;
                        case '?':           /* error */
                                usage(stderr);
                                exit(4);
@@ -326,8 +447,13 @@
 
        cl_log(LOG_INFO, "Starting SFeX Daemon...\n");
        
+       if (check_status) {
+               check_lock();
+               exit(EXIT_SUCCESS);
+       }
+
        /* acquire lock first.*/
-       acquire_lock();
+       acquire_lock(uuid);
 
        if (daemon(0, 1) != 0) {
                cl_perror("%s::%d: daemon() failed.", __FUNCTION__, __LINE__);
Index: resource-agents/tools/sfex_lib.c
===================================================================
--- resource-agents.orig/tools/sfex_lib.c       2011-10-31 17:40:14.000000000 
+0800
+++ resource-agents/tools/sfex_lib.c    2011-11-08 13:05:46.000000000 +0800
@@ -192,7 +192,7 @@
            cdata->revision);
   snprintf ((char *) (block->blocksize), sizeof (block->blocksize), "%u",
            (unsigned)cdata->blocksize);
-  snprintf ((char *) (block->numlocks), sizeof (block->numlocks), "%d",
+  snprintf ((char *) (block->numlocks), sizeof (block->numlocks), "%lu",
            cdata->numlocks);
 
   fd = dev_fd;
@@ -252,6 +252,8 @@
            ldata->count);
   snprintf ((char *) (block->nodename), sizeof (block->nodename), "%s",
            ldata->nodename);
+  snprintf ((char *) (block->uuid), sizeof (block->uuid), "%s",
+           ldata->uuid);
 
   fd = dev_fd;
 
@@ -419,11 +421,12 @@
   ldata->status = block->status;
   if (ldata->status != SFEX_STATUS_UNLOCK
       && ldata->status != SFEX_STATUS_LOCK) {
-    cl_log(LOG_ERR, "lock data format error.\n");
+    cl_log(LOG_ERR, "lock data format error:%d.\n",index);
     return -1;
   }
   ldata->count = atoi ((char *) (block->count));
   strncpy ((char *) (ldata->nodename), (const char *) (block->nodename), 
sizeof(block->nodename));
+  strncpy ((char *) (ldata->uuid), (const char *) (block->uuid), 
sizeof(block->uuid));
 
 #ifdef SFEX_DEBUG
   cl_log(LOG_INFO, "status: %c\n", ldata->status);
@@ -458,7 +461,7 @@
 #endif
 
         if (index > cdata->numlocks) {
-                cl_log(LOG_ERR, "index %d is too large. %d locks are 
stored.\n",
+                cl_log(LOG_ERR, "index %d is too large. %ld locks are 
stored.\n",
                                 index, cdata->numlocks);
                 return -1;
         }
Index: resource-agents/tools/sfex_stat.c
===================================================================
--- resource-agents.orig/tools/sfex_stat.c      2011-10-19 23:35:57.000000000 
+0800
+++ resource-agents/tools/sfex_stat.c   2011-11-08 13:09:21.000000000 +0800
@@ -78,7 +78,7 @@
   printf("  version: %d\n", cdata->version);
   printf("  revision: %d\n", cdata->revision);
   printf("  blocksize: %d\n", (int)cdata->blocksize);
-  printf("  numlocks: %d\n", cdata->numlocks);
+  printf("  numlocks: %ld\n", cdata->numlocks);
 }
 
 /*
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to