gfs2-utils: master - gfs_controld: Allow paths names to be changed, but keep defaults

Steven Whitehouse swhiteho at fedoraproject.org
Mon Oct 18 11:43:12 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=0688e9d2b94be5d47958f350ef1facacabb97041
Commit:        0688e9d2b94be5d47958f350ef1facacabb97041
Parent:        7d099f46bd374691a7e93ae36873f12633354a4f
Author:        Steven Whitehouse <swhiteho at redhat.com>
AuthorDate:    Mon Oct 18 11:44:59 2010 +0100
Committer:     Steven Whitehouse <swhiteho at redhat.com>
CommitterDate: Mon Oct 18 11:44:59 2010 +0100

gfs_controld: Allow paths names to be changed, but keep defaults

This should solve the problem which Fabio pointed out with making
the path names constant for the time being. The locations are
still changable, but there are also defaults in the code as well.

Also fixed a couple of warnings in the code which I spotted at the
same time.

Longer term we need to look carefully into whether we need to retain
either of the files in question, anyway. There are other ways of
ensuring that only one copy of a program runs at once - one way is
to open a unix socket of the type which gfs_controld already opens.

Also, we currently have three methods of logging (a) via the gfs_control
program and an internal buffer (b) to a log file and (c) to syslog.

Bearing in mind that (a) and (c) seem most useful, getting rid of (b)
seems like a possibility for the future.

Signed-off-by: Steven Whitehouse <swhiteho at redhat.com>
---
 gfs2/edit/savemeta.c         |    2 +-
 group/gfs_controld/logging.c |    5 ++++-
 group/gfs_controld/main.c    |    5 ++++-
 group/gfs_controld/util.c    |    2 +-
 4 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gfs2/edit/savemeta.c b/gfs2/edit/savemeta.c
index 480567c..290d5b4 100644
--- a/gfs2/edit/savemeta.c
+++ b/gfs2/edit/savemeta.c
@@ -67,7 +67,7 @@ static const char *anthropomorphize(unsigned long long inhuman_value)
 {
 	const char *symbols = " KMGTPE";
 	int i;
-	unsigned long long val = inhuman_value, remainder;
+	unsigned long long val = inhuman_value, remainder = 0;
 	static char out_val[32];
 
 	memset(out_val, 0, sizeof(out_val));
diff --git a/group/gfs_controld/logging.c b/group/gfs_controld/logging.c
index 93c8b99..6c6d024 100644
--- a/group/gfs_controld/logging.c
+++ b/group/gfs_controld/logging.c
@@ -10,7 +10,10 @@ extern int ccs_handle;
 #define DEFAULT_SYSLOG_FACILITY		LOG_LOCAL4 /* Is this really right? */
 #define DEFAULT_SYSLOG_PRIORITY		LOG_INFO
 #define DEFAULT_LOGFILE_PRIORITY	LOG_INFO /* ? */
-#define DEFAULT_LOGFILE			"/var/log/cluster/" DAEMON_NAME ".log"
+#ifndef LOGDIR
+#define LOGDIR "/var/log/cluster"
+#endif /* LOGDIR */
+#define DEFAULT_LOGFILE			LOGDIR "/" DAEMON_NAME ".log"
 
 static int log_mode;
 static int syslog_facility;
diff --git a/group/gfs_controld/main.c b/group/gfs_controld/main.c
index 752b3b6..3fe4227 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -5,7 +5,10 @@
 
 #include <linux/netlink.h>
 
-#define LOCKFILE_NAME	"/var/run/cluster/gfs_controld.pid"
+#ifndef CLUSTERVARRUN
+#define CLUSTERVARRUN "/var/run/cluster"
+#endif /* CLUSTERVARRUN */
+#define LOCKFILE_NAME CLUSTERVARRUN "/gfs_controld.pid"
 #define CLIENT_NALLOC   32
 #define UEVENT_BUF_SIZE 4096
 
diff --git a/group/gfs_controld/util.c b/group/gfs_controld/util.c
index 5b2e45d..440f974 100644
--- a/group/gfs_controld/util.c
+++ b/group/gfs_controld/util.c
@@ -82,7 +82,7 @@ int run_dmsetup_suspend(struct mountgroup *mg, char *dev)
 	char smajor[16];
 	char sminor[16];
 	pid_t pid;
-	int i, rv;
+	int i;
 	int major, minor;
 	FILE *fp;
 


More information about the cluster-commits mailing list