Skip to contentSkip to conversation

LVM2 ./WHATS_NEW man/clvmd.8 daemons/clvmd/clv ...

PATCH [email protected] 1 participant 1 message Aug 17, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: pcaulfield at sourceware.org 2007-08-17 11:51:23

Modified files:

	.              : WHATS_NEW 
	man            : clvmd.8 
	daemons/clvmd  : clvm.h clvmd-command.c clvmd.c clvmd.h 

refresh_clvmd.c refresh_clvmd.h

Log message:
Allow clvmd debug to be turned on in a running daemon using clvmd -d You can do with cluster-wide too, by adding -C

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.683&r2=1.684
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/man/clvmd.8.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvm.h.diff?cvsroot=lvm2&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd-command.c.diff?cvsroot=lvm2&r1=1.16&r2=1.17
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/clvmd.h.diff?cvsroot=lvm2&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/refresh_clvmd.c.diff?cvsroot=lvm2&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/refresh_clvmd.h.diff?cvsroot=lvm2&r1=1.1&r2=1.2

WHATS_NEW +1 -0
@@ -1,5 +1,6 @@
 Version 2.02.28 -
 ================================
+  Allow clvmd debug to be turned on in a running daemon using clvmd -d
   Update to use autoconf 2.61, while still supporting 2.57.
   Add more cluster info to lvmdump
   Add const attributes where possible, first cut.
man/clvmd.8 +23 -5
@@ -3,7 +3,7 @@
 clvmd \- cluster LVM daemon
 .SH SYNOPSIS
 .B clvmd
-[\-d] [\-h]
+[\-d [<value>]] [\-C] [\-h]
 [\-R]
 [\-t <timeout>]
 [\-T <start timeout>]
@@ -14,9 +14,27 @@
 if a node in the cluster does not have this daemon running.
 .SH OPTIONS
 .TP
-.I \-d
-Runs in the foreground and prints debugging information (if compiled in) to
-stderr. By default, clvmd will fork into the background when invoked.
+.I \-d [<value>]
+Enable debug logging. Value can be 0, 1 or 2.
+.br
+0 disables debug logging in a running clvmd
+.br
+1 sends debug logs to stderr (clvmd will not fork in this case)
+.br
+2 sends debug logs to syslog
+.br
+If 
+.B -d 
+is specified without a value then 1 is assumed if you are starting a
+new clvmd, 2 if you are enabling debug in a running clvmd.
+.TP
+.I \-C
+Only valid if 
+.B -d 
+is also specified. Tells all clvmds in a cluster to enable/disable debug logging.
+Without this switch, only the local clvmd will change its debug level to that
+given with 
+.B -d.
 .TP
 .I \-t <timeout>
 Specifies the timeout for commands to run around the cluster. This should not
@@ -42,7 +60,7 @@
 This timeout will be ignored if you start clvmd with the -d switch.
 .TP
 .I \-R
-Tells all the running clvmd in the cluster to reload their device cache and
+Tells all the running clvmds in the cluster to reload their device cache and
 re-read the lvm configuration file. This command should be run whenever the
 devices on a cluster system are changed.
 .TP
daemons/clvmd/clvm.h +2 -2
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002-2004 Sistina Software, Inc. All rights reserved.
- * Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+ * Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
  *
  * This file is part of LVM2.
  *
@@ -66,5 +66,5 @@
 /* Misc functions */
 #define CLVMD_CMD_REFRESH	    40
 #define CLVMD_CMD_GET_CLUSTERNAME   41
-
+#define CLVMD_CMD_SET_DEBUG	    42
 #endif
daemons/clvmd/clvmd-command.c +6 -0
@@ -75,6 +75,7 @@
 #include "clvm.h"
 #include "clvmd.h"
 
+extern debug_t debug;
 extern struct cluster_ops *clops;
 
 /* This is where all the real work happens:
@@ -137,6 +138,10 @@
 		do_refresh_cache();
 		break;
 
+	case CLVMD_CMD_SET_DEBUG:
+		debug = args[0];
+		break;
+
 	case CLVMD_CMD_GET_CLUSTERNAME:
 		status = clops->get_cluster_name(*buf, buflen);
 		if (!status)
@@ -249,6 +254,7 @@
 
 	case CLVMD_CMD_REFRESH:
 	case CLVMD_CMD_GET_CLUSTERNAME:
+	case CLVMD_CMD_SET_DEBUG:
 		break;
 
 	default:
daemons/clvmd/clvmd.c +68 -13

135 lines not on this page · raw message

daemons/clvmd/clvmd.h +2 -0
@@ -35,6 +35,8 @@
 	struct node_reply *next;
 };
 
+typedef enum {DEBUG_OFF, DEBUG_STDERR, DEBUG_SYSLOG} debug_t;
+
 /*
  * These exist for the use of local sockets only when we are
  * collecting responses from all cluster nodes
daemons/clvmd/refresh_clvmd.c +45 -2

61 lines not on this page · raw message

daemons/clvmd/refresh_clvmd.h +16 -0
@@ -1,2 +1,18 @@
+/*
+ * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
+ *
+ * This file is part of LVM2.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU General Public License v.2.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+
 int refresh_clvmd(void);
+int debug_clvmd(int level, int clusterwide);