gfs2-utils: master - GFS2: Specify some constants directly

Steven Whitehouse swhiteho at fedoraproject.org
Mon Oct 11 15:00:53 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=44c070a542f7470d1a802f2eb565f0d5b1ada6df
Commit:        44c070a542f7470d1a802f2eb565f0d5b1ada6df
Parent:        8ad7ccfab98e55b69987f8634feab9083cd86431
Author:        Steven Whitehouse <swhiteho at redhat.com>
AuthorDate:    Mon Oct 11 15:28:29 2010 +0100
Committer:     Steven Whitehouse <swhiteho at redhat.com>
CommitterDate: Mon Oct 11 15:28:29 2010 +0100

GFS2: Specify some constants directly

Some of the constants used for logging were being specified by
the build system. Since the locations are specified by the FHS
there should be no need to change them, and if there were then
it should be done at run time rather than build time.

Likewise the log level & facility. Its a bit strange that the log
level is set at all here, since that ought to be a property of
each individual message.

This code needs deeper investigation at some point.

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

diff --git a/group/gfs_controld/logging.c b/group/gfs_controld/logging.c
index 2c44b5c..93c8b99 100644
--- a/group/gfs_controld/logging.c
+++ b/group/gfs_controld/logging.c
@@ -1,3 +1,4 @@
+#include <syslog.h>
 #include "gfs_daemon.h"
 #include "config.h"
 #include "ccs.h"
@@ -6,10 +7,10 @@ extern int ccs_handle;
 
 #define DAEMON_NAME "gfs_controld"
 #define DEFAULT_LOG_MODE LOG_MODE_OUTPUT_FILE|LOG_MODE_OUTPUT_SYSLOG
-#define DEFAULT_SYSLOG_FACILITY		SYSLOGFACILITY
-#define DEFAULT_SYSLOG_PRIORITY		SYSLOGLEVEL
+#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			LOGDIR "/" DAEMON_NAME ".log"
+#define DEFAULT_LOGFILE			"/var/log/cluster/" 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 e52f04b..9583949 100644
--- a/group/gfs_controld/main.c
+++ b/group/gfs_controld/main.c
@@ -5,7 +5,7 @@
 
 #include <linux/netlink.h>
 
-#define LOCKFILE_NAME	CLUSTERVARRUN "/gfs_controld.pid"
+#define LOCKFILE_NAME	"/var/run/cluster/gfs_controld.pid"
 #define CLIENT_NALLOC   32
 #define UEVENT_BUF_SIZE 4096
 


More information about the cluster-commits mailing list