Skip to contentSkip to conversation

cluster/rgmanager ChangeLog include/reslist.h ...

Cluster-devel [email protected] 1 participant 1 message May 31, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Changes by: lhh at sourceware.org 2007-05-31 19:08:14

Modified files:
rgmanager : ChangeLog
rgmanager/include: reslist.h rgmanager/src/daemons: groups.c resrules.c restree.c rgmanager/src/resources: script.sh

Log message:

	Fix 234249, 229650

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/ChangeLog.diff?cvsroot=cluster&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/include/reslist.h.diff?cvsroot=cluster&r1=1.19&r2=1.20
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/groups.c.diff?cvsroot=cluster&r1=1.32&r2=1.33
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/resrules.c.diff?cvsroot=cluster&r1=1.21&r2=1.22
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/restree.c.diff?cvsroot=cluster&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/script.sh.diff?cvsroot=cluster&r1=1.9&r2=1.10

rgmanager/ChangeLog +6 -0
@@ -1,3 +1,9 @@
+2007-05-31 Lon Hohberger <[email protected]>
+	* src/daemons/resrules.c: Fix #234249 - ignore obvious backup files
+	in /usr/share/cluster when processing resource rules
+	* src/daemons/restree.c, src/daemons/groups.c, include/reslist.h: 
+	Implement independent subtrees, per bug #229650
+
 2007-05-22 Lon Hohberger <[email protected]>
 	* src/resources/SAPInstance, SAPDatabase: Add primary attrs
 
rgmanager/include/reslist.h +2 -0
@@ -35,6 +35,8 @@
 #define RF_NEEDSTART	(1<<2)	/** Used when adding/changing resources */
 #define RF_NEEDSTOP	(1<<3)  /** Used when deleting/changing resources */
 #define RF_COMMON	(1<<4)	/** " */
+#define RF_INDEPENDENT	(1<<5)  /** Define this for a resource if it is
+				  otherwise an independent subtree */
 
 #define RES_STOPPED	(0)
 #define RES_STARTED	(1)
rgmanager/src/daemons/groups.c +2 -0
@@ -816,6 +816,7 @@
 	}
 	pthread_rwlock_unlock(&resource_lock);
 
+#if 0
 	/*
 	   Do NOT return error codes if we failed to stop for one of these
 	   reasons.  It didn't start, either, so it's safe to assume that
@@ -833,6 +834,7 @@
 			break;
 		}
 	}
+#endif
 
 	return ret;
 }
rgmanager/src/daemons/resrules.c +18 -3
@@ -1025,7 +1025,7 @@
 {
 	DIR *dir;
 	struct dirent *de;
-	char *fn;//, *dot;
+	char *fn, *dot;
 	char path[2048];
 	struct stat st_buf;
 
@@ -1040,10 +1040,23 @@
 		if (!fn)
 			continue;
 		
+		/* Ignore files with common backup extension */
 		if ((fn != NULL) && (strlen(fn) > 0) && 
 			(fn[strlen(fn)-1] == '~')) 
 			continue;
 
+ 		dot = strrchr(fn, '.');
+ 		if (dot) {
+ 			/* Ignore RPM installed save files, patches,
+ 			   diffs, etc. */
+ 			if (!strncasecmp(dot, ".rpm", 4)) {
+ 				fprintf(stderr, "Warning: "
+ 					"Ignoring %s/%s: Bad extension %s\n",
+ 					rpath, de->d_name, dot);
+ 				continue;
+ 			}
+ 		}
+
 		snprintf(path, sizeof(path), "%s/%s",
 			 rpath, de->d_name);
 		
@@ -1053,8 +1066,10 @@
 		if (S_ISDIR(st_buf.st_mode))
 			continue;
 		
-		if (st_buf.st_mode & (S_IXUSR|S_IXOTH|S_IXGRP))
-			load_resource_rulefile(path, rules);
+  		if (st_buf.st_mode & (S_IXUSR|S_IXOTH|S_IXGRP)) {
+  			printf("Loading resource rule from %s\n", path);
+   			load_resource_rulefile(path, rules);
+  		}
 	}
 	xmlCleanupParser();
 
rgmanager/src/daemons/restree.c +117 -62

276 lines not on this page · raw message

rgmanager/src/resources/script.sh +1 -1
@@ -118,5 +118,5 @@
 declare -i rv=$?
 if [ $rv -ne 0 ]; then
 	ocf_log err "script:$OCF_RESKEY_name: $1 of $OCF_RESKEY_file failed (returned $rv)"
-	return $OCF_ERR_GENERIC
+	exit $OCF_ERR_GENERIC
 fi