Skip to contentSkip to conversation

cluster/rgmanager ChangeLog errors.txt init.d/ ...

Cluster-devel [email protected] 1 participant 1 message Nov 3, 2006

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: cluster
Branch: STABLE
Changes by: lhh at sourceware.org 2006-11-03 16:29:59

Modified files:
rgmanager : ChangeLog errors.txt
rgmanager/init.d: rgmanager
rgmanager/man : clusvcadm.8
rgmanager/src/clulib: clulog.c rgmanager/src/daemons: main.c resrules.c restree.c rg_state.c
rg_thread.c
rgmanager/src/resources: clusterfs.sh fs.sh nfsclient.sh
ocf-shellfuncs script.sh
rgmanager/src/utils: clustat.c

Log message:
Merge fixes from RHEL4 branch

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/ChangeLog.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.5.2.13.6.3&r2=1.5.2.13.6.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/errors.txt.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1.2.4&r2=1.1.2.4.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/init.d/rgmanager.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.3.2.1.6.1&r2=1.3.2.1.6.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/man/clusvcadm.8.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1.2.1.6.1&r2=1.1.2.1.6.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/clulib/clulog.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.2.2.1.6.2&r2=1.2.2.1.6.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/main.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.9.2.8.6.7&r2=1.9.2.8.6.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/resrules.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.9.2.2&r2=1.9.2.2.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/restree.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.10.2.2.6.8&r2=1.10.2.2.6.9
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_state.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.4.2.8.6.4&r2=1.4.2.8.6.5
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/rg_thread.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.7.2.3.6.3&r2=1.7.2.3.6.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/clusterfs.sh.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.1.2.3.4.5&r2=1.1.2.3.4.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/fs.sh.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.4.2.6.4.6&r2=1.4.2.6.4.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/nfsclient.sh.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.3.2.2.6.6&r2=1.3.2.2.6.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/ocf-shellfuncs.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.2.2.2&r2=1.2.2.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/script.sh.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.3.2.2.6.2&r2=1.3.2.2.6.3
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/utils/clustat.c.diff?cvsroot=cluster&only_with_tag=STABLE&r1=1.5.2.3.6.8&r2=1.5.2.3.6.9

rgmanager/ChangeLog +24 -0
@@ -1,3 +1,27 @@
+2006-11-03 Lon Hohberger <[email protected]>
+	* src/daemons/restree.c: Merge patch from Jeff Layton to instrument
+	res_exec more closely. (#213246)
+	* src/daemons/rg_thread.c: Fix segfault caused by improper loop 
+	semantics (#213312)
+
+2006-10-05 Lon Hohberger <[email protected]>
+	* src/clulib/clulog.c: Change stdout/stderr to nonblocking (#207144
+	part 1)
+	* src/daemons/main.c: Give a timeout for a message to be received
+	after msg_accept() so that if we are processing a message from a
+	client which died, we don't wait forever, thereby preventing
+        group updates (#207144 part 2).
+
+2006-09-27 Lon Hohberger <[email protected]>
+	* src/daemons/rg_state.c: Fix fail->disable state transitions,
+	bugzilla #208011
+
+2006-09-07 Lon Hohberger <[email protected]>
+	* src/daemons/main.c, init.d/rgmanager: Make rgmanager init script
+	report failure correctly in most cases. (#193603)
+	* src/utils/clustat.c: Fix #146924 - segfault if cman is not
+	in a state to give out member lists
+
 2006-06-21 Lon Hohberger <[email protected]>
 	* src/daemons/nodeevent.c: Don't use the rg thread refcount in
 	node event handling (#194491)
rgmanager/errors.txt +3 -1
@@ -76,7 +76,9 @@
 The resource group manager was unable to find a plugin which was able to
 talk to the cluster infrastructure.  Generally, this occurs when no cluster
 infrastruture is running.  Try starting the preferred cluster infrastructure
-for your configuration (e.g. CMAN+DLM, GuLM) and restarting rgmanager.
+for your configuration (e.g. CMAN+DLM, GuLM) and restarting rgmanager.  This
+can also occur if CMAN is loaded, while DLM is not.  Rgmanager (really,
+the SM magma plugin) requires that the DLM be loaded prior to starting.
 
 #10: Couldn't set up listen socket
 
rgmanager/init.d/rgmanager +1 -0
@@ -93,6 +93,7 @@
 
 case $1 in
 	start)
+		[ -z "$RGMGR_OPTS" ] && RGMGR_OPTS="-t 30"
 		echo -n $"Starting $ID: "
 		daemon $RGMGRD $RGMGR_OPTS
 		echo
rgmanager/man/clusvcadm.8 +5 -0
@@ -67,6 +67,11 @@
 preferred
 target member on which to start the 
 service.
+.IP "\-r <service>"
+Relocates the user service named
+.I
+service
+to another cluster member.
 .IP "\-R <service>"
 Restarts the user service named
 .I
rgmanager/src/clulib/clulog.c +22 -3
@@ -20,7 +20,7 @@
 /** @file
  * Library routines for communicating with the logging daemon.
  *
- *  $Id: clulog.c,v 1.2.2.1.6.2 2006/06/16 20:07:46 lhh Exp $
+ *  $Id: clulog.c,v 1.2.2.1.6.3 2006/11/03 16:29:58 lhh Exp $
  *
  *  Author: Jeff Moyer <[email protected]>
  */
@@ -50,7 +50,7 @@
 #include <string.h>
 
 
-static const char *version __attribute__ ((unused)) = "$Revision: 1.2.2.1.6.2 $";
+static const char *version __attribute__ ((unused)) = "$Revision: 1.2.2.1.6.3 $";
 
 #ifdef DEBUG
 #include <assert.h>
@@ -183,6 +183,14 @@
 clu_log_console(int onoff)
 {
 	int ret = useconsole;
+	int val;
+
+	if (onoff) {
+		val = fcntl(STDERR_FILENO, F_GETFL, 0);
+		fcntl(STDERR_FILENO, F_SETFL, val|O_NONBLOCK);
+		val = fcntl(STDOUT_FILENO, F_GETFL, 0);
+		fcntl(STDOUT_FILENO, F_SETFL, val|O_NONBLOCK);
+	}
 
 	useconsole = !!onoff;
 	return ret;
@@ -204,6 +212,7 @@
 	char         logmsg[MAX_LOGMSG_LEN];	/* message to go to the log */
 	char         printmsg[MAX_LOGMSG_LEN];	/* message to go to stdout */
 	int          syslog_flags = LOG_NDELAY;
+	int	     val;
 
 	pthread_mutex_lock(&log_mutex);
 	if (severity > loglevel) {
@@ -275,9 +284,19 @@
 			  MAX_LOGMSG_LEN - strlen(printmsg), fmt, args);
 		va_end(args);
 
-		fprintf(stdout, "%s", printmsg);
+		if (useconsole && !write_to_cons) {
+			val = fcntl(STDOUT_FILENO, F_GETFL, 0);
+			fcntl(STDOUT_FILENO, F_SETFL, val | O_NONBLOCK);
+		}
+
+		/* Ignore error return code */
+		write(STDOUT_FILENO, printmsg, strlen(printmsg));
+
+		if (useconsole && !write_to_cons)
+			fcntl(STDOUT_FILENO, F_SETFL, val);
 	}
 
+	/* TODO make this non-blocking */
 	syslog(severity, logmsg);
 
 	pthread_mutex_unlock(&log_mutex);
rgmanager/src/daemons/main.c +68 -2

134 lines not on this page · raw message

rgmanager/src/daemons/resrules.c +50 -1

75 lines not on this page · raw message

rgmanager/src/daemons/restree.c +36 -6

86 lines not on this page · raw message

rgmanager/src/daemons/rg_state.c +12 -1
@@ -879,6 +879,7 @@
 	void *lockp = NULL;
 	rg_state_t svcStatus;
 	int ret;
+	int old_state;
 
 	if (!rg_quorate()) {
 		clulog(LOG_WARNING, "#69: Unclean %s of %s\n", 
@@ -918,6 +919,8 @@
 		break;
 	}
 
+	old_state = svcStatus.rs_state;
+
 	clulog(LOG_NOTICE, "Stopping service %s\n", svcName);
 
 	if (recover)
@@ -937,7 +940,15 @@
 
 	ret = group_op(svcName, RG_STOP);
 
-	_svc_stop_finish(svcName, ret, newstate);
+	if (old_state == RG_STATE_FAILED && newstate == RG_STATE_DISABLED) {
+		if (ret)
+			clulog(LOG_ALERT, "Marking %s as 'disabled', "
+			       "but some resources may still be allocated!\n",
+			       svcName);
+		_svc_stop_finish(svcName, 0, newstate);
+	} else {
+		_svc_stop_finish(svcName, ret, newstate);
+	}
 
 	return ret;
 }
rgmanager/src/daemons/rg_thread.c +12 -8
@@ -110,18 +110,22 @@
 purge_status_checks(request_t **list)
 {
 	request_t *curr;
+	int found;
 	
 	if (!list)
 		return;
 
-	list_do(list, curr) {
-		if (curr->rr_request != RG_STATUS)
-			continue;
-
-		list_remove(list, curr);
-		rq_free(curr);
-		curr = *list;
-	} while (!list_done(list, curr));
+	do {
+		found = 0;
+		list_do(list, curr) {
+			if (curr->rr_request == RG_STATUS) {
+				list_remove(list, curr);
+				rq_free(curr);
+				found = 1;
+				break;
+			}
+		} while (!list_done(list, curr));
+	} while (found);
 }
 
 
rgmanager/src/resources/clusterfs.sh +9 -4
@@ -802,6 +802,7 @@
 	   [ "$OCF_RESKEY_nfslock" = "1" ]; then
 		ocf_log warning "Dropping node-wide NFS locks"
 		mkdir -p $mp/.clumanager/statd
+		pkill -KILL -x lockd
 		# Copy out the notify list; our 
 			# IPs are already torn down
 			if notify_list_store $mp/.clumanager/statd; then
@@ -889,12 +890,16 @@
 	;;
 status|monitor)
   	isMounted ${OCF_RESKEY_device} ${OCF_RESKEY_mountpoint}
- 	[ $? -ne $YES ] && exit $OCF_ERR_GENERIC
+ 	if [ $? -ne $YES ]; then
+		ocf_log err "fs:${OCF_RESKEY_name}: ${OCF_RESKEY_device} is not mounted on ${OCF_RESKEY_mountpoint}"
+		exit $OCF_ERR_GENERIC
+	fi
 
  	isAlive ${OCF_RESKEY_mountpoint}
- 	[ $? -ne $YES ] && exit $OCF_ERR_GENERIC
- 	
-	exit 0
+ 	[ $? -eq $YES ] && exit 0
+
+	ocf_log err "fs:${OCF_RESKEY_name}: Mount point is not accessible!"
+	exit $OCF_ERR_GENERIC
 	;;
 restart)
 	stopFilesystem
rgmanager/src/resources/fs.sh +35 -22

169 lines not on this page · raw message

rgmanager/src/resources/nfsclient.sh +4 -0
@@ -340,7 +340,11 @@
 		sed -e 's/*/[*]/g' -e 's/?/[?]/g' -e 's/\./\\./g') 
         exportfs -v | tr -d "\n" | sed -e 's/([^)]*)/\n/g' | grep -q \
 		"^${OCF_RESKEY_path}[\t ]*.*${OCF_RESKEY_target_regexp}" 
+
 	rv=$? 
+	if [ $rv -ne 0 ]; then
+		ocf_log err "nfsclient:$OCF_RESKEY_name is missing!"
+	fi
 	;;
 
 recover)
rgmanager/src/resources/ocf-shellfuncs +1 -1
@@ -1,5 +1,5 @@
 #
-# 	$Id: ocf-shellfuncs,v 1.2.2.2 2006/06/16 20:07:46 lhh Exp $
+# 	$Id: ocf-shellfuncs,v 1.2.2.3 2006/11/03 16:29:58 lhh Exp $
 #
 # 	Common helper functions for the OCF Resource Agents supplied by
 # 	heartbeat.
rgmanager/src/resources/script.sh +7 -1
@@ -110,4 +110,10 @@
 
 # Don't need to catch return codes; this one will work.
 ocf_log info "Executing ${OCF_RESKEY_file} $1"
-exec /bin/sh ${OCF_RESKEY_file} $1
+${OCF_RESKEY_file} $1
+
+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
+fi
rgmanager/src/utils/clustat.c +12 -1
@@ -486,6 +486,11 @@
 {
 	int x;
 
+	if (!membership) {
+		printf("Membership information not available\n");
+		return;
+	}
+
 	printf("  %-40.40s %s\n", "Member Name", "Status");
 	printf("  %-40.40s %s\n", "------ ----", "------");
 
@@ -504,8 +509,10 @@
 {
 	int x;
 
-	if (!membership)
+	if (!membership) {
+		printf("  <nodes/>\n");
 		return;
+	}
 
 	printf("  <nodes>\n");
 	for (x = 0; x < membership->cml_count; x++) {
@@ -608,6 +615,10 @@
 	/* Grab the local node ID and flag it from the list of reported
 	   online nodes */
 	clu_local_nodeid(NULL, lid);
+
+	if (!all)
+		return NULL;
+
 	for (x=0; x<all->cml_count; x++) {
 		if (all->cml_members[x].cm_id == *lid) {
 			m = &all->cml_members[x];