Hi guys,

the patch makes it possible to change the default configuration file by setting DEFAULT_CONFIG_DIR (default to /etc/cluster) and DEFAULT_CONFIG_FILE (cluster.conf).

I need to address two small issues before I can commit it (hence the RFC).

rgmanager/src/resources/utils/config-utils.sh
cman/init.d/cman
rgmanager/init.d/rgmanager

and a bunch of manpages hard encoded file name and path.

Fixing those is easy but to do it clean, I would have to rename them to something .in and that would kill the RCS history and I don't like that.

The other solution would be to place some sed magic at install: time that is a bit more "dirty" but IMHO good enough for a temporary solution while we wait for a proper RCS to appear. Suggestion? Ideas?

This patch can wait.. it really lands in the category of "nice to have".

Thanks
Fabio

 ccs/ccs_tool/editconf.c          |   10 +++----
 ccs/ccs_tool/update.c            |    2 -
 ccs/daemon/ccsd.c                |    6 ++--
 ccs/daemon/cluster_mgr.c         |   16 +++++------
 ccs/daemon/cnx_mgr.c             |   54 +++++++++++++++++++--------------------
 ccs/daemon/globals.h             |    1
 ccs/lib/libccs.c                 |    9 +++---
 cman/daemon/cmanccs.c            |    8 ++---
 configure                        |   14 ++++++++++
 fence/agents/xvm/options.c       |    2 -
 fence/agents/xvm/simple_auth.h   |    2 -
 fence/fenced/main.c              |    4 +-
 make/defines.mk.input            |    3 +-
 rgmanager/src/daemons/rg_locks.c |    2 -
 14 files changed, 74 insertions(+), 59 deletions(-)

Index: configure
===================================================================
RCS file: /cvs/cluster/cluster/configure,v
retrieving revision 1.45
diff -u -r1.45 configure
--- configure   21 Dec 2007 07:28:37 -0000      1.45
+++ configure   2 Jan 2008 11:01:49 -0000
@@ -75,6 +75,8 @@
        prefix => \$prefix,
        sbindir => \$sbindir,
        sharedir => \$sharedir,
+       confdir => \$confdir,
+       conffile => \$conffile,
        fence_agents => \$fence_agents,
        enable_xen => \$enable_xen,
        release_major => \$release_major,
@@ -137,6 +139,8 @@
                    'prefix=s',
                    'sbindir=s',
                    'sharedir=s',
+                   'confdir=s',
+                   'conffile=s',
                    'release_major=s',
                    'release_minor=s',
                    'fence_agents=s',
@@ -169,6 +173,8 @@
   print "--libdir=\tthe base directory for libraries.  (Default: 
{prefix}/lib)\n";
   print "--libexecdir=\tthe base directory for executable components.  (Default: 
{prefix}/libexec)\n";
   print "--sharedir=\tthe base directory for misc cluster files.  (Default: 
{prefix}/share/cluster)\n";
+  print "--confdir=\tthe cluster config directory.  (Default: /etc/cluster)\n";
+  print "--conffile=\tthe cluster config file.  (Default: cluster.conf)\n";
   print "--mandir=\tthe base directory for man pages.  (Default: 
{prefix}/share/man)\n";
   print "--module_dir=\tthe base directory for kernel modules.  (Default:  
/lib/modules/`uname -r`/kernel\n";
   print "\nbuild flags:\n";
@@ -473,6 +479,12 @@
 if (!$sharedir) {
   $sharedir="${prefix}/share/cluster";
 }
+if (!$confdir) {
+  $confdir="/etc/cluster";
+}
+if (!$conffile) {
+  $conffile="cluster.conf";
+}
 if (!$fence_agents) {
   $fence_agents="all";
 }
@@ -584,6 +596,8 @@
   $_ =~ s/[EMAIL PROTECTED]@/$mandir/;
   $_ =~ s/[EMAIL PROTECTED]@/$sbindir/;
   $_ =~ s/[EMAIL PROTECTED]@/$sharedir/;
+  $_ =~ s/[EMAIL PROTECTED]@/$confdir/;
+  $_ =~ s/[EMAIL PROTECTED]@/$conffile/;
   $_ =~ s/[EMAIL PROTECTED]@/$fence_agents/;
   $_ =~ s/[EMAIL PROTECTED]@/$enable_xen/;
   $_ =~ s/[EMAIL PROTECTED]@/$without_ccs/;
Index: ccs/ccs_tool/editconf.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/ccs_tool/editconf.c,v
retrieving revision 1.12
diff -u -r1.12 editconf.c
--- ccs/ccs_tool/editconf.c     13 Dec 2007 10:38:42 -0000      1.12
+++ ccs/ccs_tool/editconf.c     2 Jan 2008 11:01:49 -0000
@@ -26,7 +26,7 @@
 #include "update.h"

 #define MAX_NODES 256
-#define DEFAULT_CONFIG_FILE "/etc/cluster/cluster.conf"
+
 char *prog_name = "ccs_tool";

 #define die(fmt, args...) \
@@ -54,7 +54,7 @@

 static void config_usage(int rw)
 {
-       fprintf(stderr, " -c --configfile    Name of configuration file 
(/etc/cluster/cluster.conf)\n");
+       fprintf(stderr, " -c --configfile    Name of configuration file (" DEFAULT_CONFIG_DIR 
"/" DEFAULT_CONFIG_FILE ")\n");
        if (rw)
        {
                fprintf(stderr, " -o --outputfile    Name of output file (defaults 
to same as --configfile)\n");
@@ -543,14 +543,14 @@
        LIBXML_TEST_VERSION;

        if (!ninfo->configfile)
-               ninfo->configfile = DEFAULT_CONFIG_FILE;
+               ninfo->configfile = DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE;
        if (!ninfo->outputfile)
                ninfo->outputfile = ninfo->configfile;

        /* Load XML document */
        doc = xmlParseFile(ninfo->configfile);
        if (doc == NULL)
-               die("Error: unable to parse cluster.conf file\n");
+               die("Error: unable to parse requested configuration file\n");

        return doc;

@@ -1036,7 +1036,7 @@
                }
        }
        if (!ninfo.outputfile)
-               ninfo.outputfile = DEFAULT_CONFIG_FILE;
+               ninfo.outputfile = DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE;
        ninfo.configfile = "-";

        if (argc - optind < 1)
Index: ccs/ccs_tool/update.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/ccs_tool/update.c,v
retrieving revision 1.13
diff -u -r1.13 update.c
--- ccs/ccs_tool/update.c       19 Jun 2007 18:08:01 -0000      1.13
+++ ccs/ccs_tool/update.c       2 Jan 2008 11:01:49 -0000
@@ -379,7 +379,7 @@
            "  Old config version :: %d\n"
            "  Proposed config version :: %d\n"
            "  Winning config version  :: %d\n\n"
-           "Check /etc/cluster/cluster.conf to ensure it contains the desired 
contents.\n", v1, v2, v3);
+           "Check " DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE " to ensure it 
contains the desired contents.\n", v1, v2, v3);
     return -EAGAIN;
   }

Index: ccs/daemon/ccsd.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/daemon/ccsd.c,v
retrieving revision 1.29
diff -u -r1.29 ccsd.c
--- ccs/daemon/ccsd.c   30 Aug 2007 21:31:41 -0000      1.29
+++ ccs/daemon/ccsd.c   2 Jan 2008 11:01:50 -0000
@@ -271,7 +271,7 @@
          " -t <ttl>      Multicast threshold (aka Time to Live) value.\n"
          " -P [bcf]:#    Specify various port numbers.\n"
          " -V            Print version information.\n"
-         " -X            No cluster manager, just read local cluster.conf.\n"
+         " -X            No cluster manager, just read local " DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE ".\n"
          );
   EXIT("print_usage");
 }
@@ -319,7 +319,7 @@

   ENTER("parse_cli_args");

-  config_file_location = strdup(DEFAULT_CONFIG_LOCATION);
+  config_file_location = strdup(DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE);
   lockfile_location = strdup(DEFAULT_CCSD_LOCKFILE);

   if(!config_file_location || !lockfile_location){
@@ -530,7 +530,7 @@
   } else {
     /* no cluster.conf file.  This is fine, just need to get it from the 
network */
     if(no_manager_opt){
-      log_err("\nNo local cluster.conf found: %s\n", config_file_location);
+      log_err("\nNo local config file found: %s\n", config_file_location);
       return -1;
     }
   }
Index: ccs/daemon/cluster_mgr.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/daemon/cluster_mgr.c,v
retrieving revision 1.26
diff -u -r1.26 cluster_mgr.c
--- ccs/daemon/cluster_mgr.c    2 May 2007 12:42:43 -0000       1.26
+++ ccs/daemon/cluster_mgr.c    2 Jan 2008 11:01:50 -0000
@@ -194,18 +194,18 @@

     old_mode = umask(026);

-    fp = fopen("/etc/cluster/cluster.conf-update", "w");
+    fp = fopen(DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE "-update", "w");

     umask(old_mode);

     if (!fp) {
-      log_sys_err("Unable to open /etc/cluster/cluster.conf-update");
+      log_sys_err("Unable to open " DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE 
"-update");
       error = -errno;
       goto fail;
     }

     if (xmlDocDump(fp, tmp_doc) < 0) {
-      log_sys_err("Unable to write /etc/cluster/cluster.conf-update");
+      log_sys_err("Unable to write " DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE 
"-update");
       goto fail;
     }

@@ -248,7 +248,7 @@

     log_dbg("Got lock 1\n");

-    tmp_doc = xmlParseFile("/etc/cluster/cluster.conf-update");
+    tmp_doc = xmlParseFile(DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE 
"-update");

     if (!tmp_doc) {
       log_err("Unable to parse updated config file.\n");
@@ -263,22 +263,22 @@

     old_mode = umask(026);

-    fp = fopen("/etc/cluster/.cluster.conf", "w");
+    fp = fopen(DEFAULT_CONFIG_DIR "/." DEFAULT_CONFIG_FILE, "w");

     umask(old_mode);

     if (!fp) {
-      log_sys_err("Unable to open /etc/cluster/.cluster.conf");
+      log_sys_err("Unable to open " DEFAULT_CONFIG_DIR "/." 
DEFAULT_CONFIG_FILE);
       error = -errno;
       goto fail;
     }

     if (xmlDocDump(fp, tmp_doc) < 0) {
-      log_sys_err("Unable to write /etc/cluster/.cluster.conf");
+      log_sys_err("Unable to write " DEFAULT_CONFIG_DIR "/." 
DEFAULT_CONFIG_FILE);
       goto fail;
     }

-    rename("/etc/cluster/cluster.conf-update", "/etc/cluster/cluster.conf");
+    rename(DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE "-update", DEFAULT_CONFIG_DIR 
"/" DEFAULT_CONFIG_FILE);

     update_required = 1;
     ch.comm_flags = COMM_UPDATE_COMMIT_ACK;
Index: ccs/daemon/cnx_mgr.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/daemon/cnx_mgr.c,v
retrieving revision 1.44
diff -u -r1.44 cnx_mgr.c
--- ccs/daemon/cnx_mgr.c        11 Dec 2007 20:58:00 -0000      1.44
+++ ccs/daemon/cnx_mgr.c        2 Jan 2008 11:01:50 -0000
@@ -83,13 +83,13 @@
     error = -EINVAL;
     goto fail;
   } else if((v2 = get_doc_version(tmp_doc)) < 0){
-    log_err("Unable to get config_version from cluster.conf.\n");
+    log_err("Unable to get config_version from %s.\n", location);
     error = v2;
     goto fail;
   } else if(master_doc && master_doc->od_doc){
     v1 = get_doc_version(master_doc->od_doc);
     if(v1 >= v2){
-      log_err("cluster.conf on-disk version is <= to in-memory version.\n");
+      log_err("%s on-disk version is <= to in-memory version.\n", location);
       log_err(" On-disk version   : %d\n", v2);
       log_err(" In-memory version : %d\n", v1);
       error = -EPERM;
@@ -118,7 +118,7 @@
     master_doc = tmp_odoc;
   }

-  log_msg("Update of cluster.conf complete (version %d -> %d).\n", v1, v2);
+  log_msg("Update of "DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE " complete (version 
%d -> %d).\n", v1, v2);
  fail:
   if(tmp_odoc != master_doc){
     free(tmp_odoc);
@@ -140,7 +140,7 @@
   /* If update_required is set, it means that there is still a pending **
   ** update.  We need to pull this one in before doing anything else.  */
   if(update_required){
-    error = _update_config("/etc/cluster/.cluster.conf");
+    error = _update_config(DEFAULT_CONFIG_DIR "/." DEFAULT_CONFIG_FILE);
     update_required = 0;
     if(error){
       log_err("Previous update could not be completed.\n");
@@ -348,7 +348,7 @@
        tmp_doc = xmlParseMemory(bdoc+sizeof(comm_header_t),
                                 ch->comm_payload_size);
        if(!tmp_doc){
-         log_err("Unable to parse remote cluster.conf.\n");
+         log_err("Unable to parse remote configuration.\n");
          free(bdoc); bdoc = NULL;
          goto reset_timer;
        }
@@ -357,12 +357,12 @@
        log_dbg("  Given cluster name = %s\n", cluster_name);
        log_dbg("  Remote cluster name= %s\n", tmp_name);
        if(!tmp_name){
-         log_err("Unable to find cluster name in remote cluster.conf.\n");
+         log_err("Unable to find cluster name in remote configuration.\n");
          free(bdoc); bdoc = NULL;
          xmlFreeDoc(tmp_doc); tmp_doc = NULL;
          goto reset_timer;
        } else if(cluster_name && strcmp(cluster_name, tmp_name)){
-         log_dbg("Remote and local cluster.conf have different cluster 
names.\n");
+         log_dbg("Remote and local configuration have different cluster 
names.\n");
          log_dbg("Skipping...\n");
          free(tmp_name); tmp_name = NULL;
          free(bdoc); bdoc = NULL;
@@ -372,7 +372,7 @@
        free(tmp_name); tmp_name = NULL;
        if(!master_doc->od_doc){
          if((v2 = get_doc_version(tmp_doc)) >= 0){
-           log_msg("Remote copy of cluster.conf (version = %d) found.\n", v2);
+           log_msg("Remote configuration copy (version = %d) found.\n", v2);
            master_doc->od_doc = tmp_doc;
            tmp_doc = NULL;
            write_to_disk = 1;
@@ -381,7 +381,7 @@
          if(((v1 = get_doc_version(master_doc->od_doc)) >= 0) &&
             ((v2 = get_doc_version(tmp_doc)) >= 0)){
            if(ch->comm_flags & COMM_BROADCAST_FROM_QUORATE){
-             log_msg("Remote copy of cluster.conf is from quorate node.\n");
+             log_msg("Remote configuration copy is from quorate node.\n");
              log_msg(" Local version # : %d\n", v1);
              log_msg(" Remote version #: %d\n", v2);
              if(v1 != v2){
@@ -404,7 +404,7 @@
              write_to_disk = 1;
              goto out;
            } else if(v2 > v1){
-             log_msg("Remote copy of cluster.conf is newer than local 
copy.\n");
+             log_msg("Remote configuration copy is newer than local copy.\n");
              log_msg(" Local version # : %d\n", v1);
              log_msg(" Remote version #: %d\n", v2);
              if(master_doc->od_refs){
@@ -451,23 +451,23 @@

     /* ATTENTION -- its bad if we fail here, because we have an in-memory 
version **
     ** but it has not been written to 
disk....................................... */
-    if(stat("/etc/cluster", &stat_buf)){
-      if(mkdir("/etc/cluster", S_IRWXU | S_IRWXG)){
-       log_sys_err("Unable to create directory /etc/cluster");
+    if(stat(DEFAULT_CONFIG_DIR, &stat_buf)){
+      if(mkdir(DEFAULT_CONFIG_DIR, S_IRWXU | S_IRWXG)){
+       log_sys_err("Unable to create directory " DEFAULT_CONFIG_DIR);
        error = -errno;
        goto fail;
       }
     } else if(!S_ISDIR(stat_buf.st_mode)){
-      log_err("/etc/cluster is not a directory.\n");
+      log_err(DEFAULT_CONFIG_DIR " is not a directory.\n");
       error = -ENOTDIR;
       goto fail;
     }

     old_mode = umask(026);
-    f = fopen("/etc/cluster/cluster.conf", "w");
+    f = fopen(DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE, "w");
     umask(old_mode);
     if(!f){
-      log_sys_err("Unable to open /etc/cluster/cluster.conf");
+      log_sys_err("Unable to open " DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE);
       error = -errno;
       goto fail;
     }
@@ -535,28 +535,28 @@
   }

   if(!master_doc->od_doc){
-    master_doc->od_doc = xmlParseFile("/etc/cluster/cluster.conf");
+    master_doc->od_doc = xmlParseFile(DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE);
     if(!master_doc->od_doc){
-      log_msg("Unable to parse %s\n", "/etc/cluster/cluster.conf");
+      log_msg("Unable to parse " DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE 
"\n");
       log_msg("Searching cluster for valid copy.\n");
     } else if((error = get_doc_version(master_doc->od_doc)) < 0){
-      log_err("Unable to get config_version from cluster.conf.\n");
+      log_err("Unable to get config_version from " DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE ".\n");
       log_err("Discarding data and searching for valid copy.\n");
       xmlFreeDoc(master_doc->od_doc);
       master_doc->od_doc = NULL;
     } else if(!(tmp_name = get_cluster_name(master_doc->od_doc))){
-      log_err("Unable to get cluster name from cluster.conf.\n");
+      log_err("Unable to get cluster name from " DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE ".\n");
       log_err("Discarding data and searching for valid copy.\n");
       xmlFreeDoc(master_doc->od_doc);
       master_doc->od_doc = NULL;
     } else if(cluster_name && strcmp(cluster_name, tmp_name)){
-      log_err("Given cluster name does not match local cluster.conf.\n");
+      log_err("Given cluster name does not match local " DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE ".\n");
       log_err("Discarding data and searching for matching copy.\n");
       xmlFreeDoc(master_doc->od_doc);
       master_doc->od_doc = NULL;
       free(tmp_name); tmp_name = NULL;
     } else {  /* Either the names match, or a name wasn't specified. */
-      log_msg("cluster.conf (cluster name = %s, version = %d) found.\n",
+      log_msg(DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE " (cluster name = %s, 
version = %d) found.\n",
              tmp_name, error);
       /* We must check with the others to make sure this is valid. */
     }
@@ -570,8 +570,8 @@
     ** for the config of the name specified............................... */

     if(cluster_name && strcmp(cluster_name, tmp_name)){
-      log_err("Request for cluster.conf with cluster name, %s\n", 
cluster_name);
-      log_err(" However, a cluster.conf with cluster name, %s, is already 
loaded.\n",
+      log_err("Request for configuration with cluster name, %s\n", 
cluster_name);
+      log_err(" However, a configuration with cluster name, %s, is already 
loaded.\n",
              tmp_name);
       error = -EINVAL;
       goto fail;
@@ -1326,11 +1326,11 @@
       goto fail;
     }
     memset(master_doc, 0, sizeof(open_doc_t));
-    master_doc->od_doc = xmlParseFile("/etc/cluster/cluster.conf");
+    master_doc->od_doc = xmlParseFile(DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE);
     if(!master_doc->od_doc){
       free(master_doc);
       master_doc = NULL;
-      log_err("Unable to parse %s.\n", "/etc/cluster/cluster.conf");
+      log_err("Unable to parse " DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE 
".\n");
       error = -ENODATA;
       goto fail;
     }
@@ -1370,7 +1370,7 @@
   swab_header(ch); /* Swab back to dip into ch for payload_size */
   memcpy(buffer+sizeof(comm_header_t), payload, ch->comm_payload_size);

-  log_dbg("Sending cluster.conf (version %d)...\n", 
get_doc_version(master_doc->od_doc));
+  log_dbg("Sending configuration (version %d)...\n", 
get_doc_version(master_doc->od_doc));
   sendlen = ch->comm_payload_size + sizeof(comm_header_t);
   if(sendto(sfd, buffer, sendlen, 0,
            (struct sockaddr *)&addr, (socklen_t)len) < 0){
Index: ccs/daemon/globals.h
===================================================================
RCS file: /cvs/cluster/cluster/ccs/daemon/globals.h,v
retrieving revision 1.5
diff -u -r1.5 globals.h
--- ccs/daemon/globals.h        11 Jan 2006 16:00:55 -0000      1.5
+++ ccs/daemon/globals.h        2 Jan 2008 11:01:50 -0000
@@ -12,7 +12,6 @@
 #ifndef __GLOBALS_H__
 #define __GLOBALS_H__

-#define DEFAULT_CONFIG_LOCATION "/etc/cluster/cluster.conf"
 #define DEFAULT_CCSD_LOCKFILE "/var/run/cluster/ccsd.pid"

 #define EXIT_MAGMA_PLUGINS 2  /* Magma plugins are not available */
Index: ccs/lib/libccs.c
===================================================================
RCS file: /cvs/cluster/cluster/ccs/lib/libccs.c,v
retrieving revision 1.13
diff -u -r1.13 libccs.c
--- ccs/lib/libccs.c    26 Oct 2007 19:18:10 -0000      1.13
+++ ccs/lib/libccs.c    2 Jan 2008 11:01:50 -0000
@@ -376,10 +376,11 @@
  *
  * This function will only allow a connection even if the node is not
  * part of a quorate cluster.  It will use the configuration file
- * located in /etc/cluster/cluster.conf.  If that file does not exist,
- * a copy of the file will be broadcasted for.  If blocking is specified,
- * the broadcasts will be retried until a config file is located.  Otherwise,
- * the fuction will return an error if the initial broadcast is not successful.
+ * as specified at build time (default: /etc/cluster/cluster.conf).  If that
+ * file does not exist, a copy of the file will be broadcasted for.  If
+ * blocking is specified, the broadcasts will be retried until a config file
+ * is located.  Otherwise, the fuction will return an error if the initial
+ * broadcast is not successful.
  *
  * Returns: ccs_desc on success, < 0 on failure
  */
Index: cman/daemon/cmanccs.c
===================================================================
RCS file: /cvs/cluster/cluster/cman/daemon/cmanccs.c,v
retrieving revision 1.38
diff -u -r1.38 cmanccs.c
--- cman/daemon/cmanccs.c       29 Nov 2007 11:19:12 -0000      1.38
+++ cman/daemon/cmanccs.c       2 Jan 2008 11:01:50 -0000
@@ -35,7 +35,7 @@

 #define DEFAULT_PORT            5405
 #define DEFAULT_CLUSTER_NAME    "RHCluster"
-#define NOCCS_KEY_FILENAME      "/etc/cluster/cman_authkey"
+#define NOCCS_KEY_FILENAME      DEFAULT_CONFIG_DIR "/cman_authkey"

 #define CONFIG_VERSION_PATH    "/cluster/@config_version"
 #define CLUSTER_NAME_PATH      "/cluster/@name"
@@ -588,9 +588,9 @@
        /* Find our nodename in cluster.conf */
        error = verify_nodename(cd, nodename);
        if (error) {
-               log_printf(LOG_ERR, "local node name \"%s\" not found in 
cluster.conf",
+               log_printf(LOG_ERR, "local node name \"%s\" not found in the 
configuration",
                        nodename);
-               write_cman_pipe("Can't find local node name in cluster.conf");
+               write_cman_pipe("Can't find local node name in the 
configuration");
                error = -ENOENT;
                goto out;
        }
@@ -707,7 +707,7 @@
        }

        if (!nodeid) {
-               log_printf(LOG_ERR, "No nodeid specified in cluster.conf");
+               log_printf(LOG_ERR, "No nodeid specified in configuration 
file");
                write_cman_pipe("CCS does not have a nodeid for this node, run 
'ccs_tool addnodeids' to fix");
                return -EINVAL;
        }
Index: fence/agents/xvm/options.c
===================================================================
RCS file: /cvs/cluster/cluster/fence/agents/xvm/options.c,v
retrieving revision 1.5
diff -u -r1.5 options.c
--- fence/agents/xvm/options.c  26 Jun 2007 17:23:41 -0000      1.5
+++ fence/agents/xvm/options.c  2 Jan 2008 11:01:50 -0000
@@ -303,7 +303,7 @@
          assign_auth },

        { 'k', "-k <file>", "key_file",
-         "Shared key file (default=/etc/cluster/fence_xvm.key)",
+         "Shared key file (default=" DEFAULT_CONFIG_DIR "/fence_xvm.key)",
          assign_key },

        { 'o', "-o <operation>", "option",
Index: fence/agents/xvm/simple_auth.h
===================================================================
RCS file: /cvs/cluster/cluster/fence/agents/xvm/simple_auth.h,v
retrieving revision 1.1
diff -u -r1.1 simple_auth.h
--- fence/agents/xvm/simple_auth.h      5 Oct 2006 16:11:36 -0000       1.1
+++ fence/agents/xvm/simple_auth.h      2 Jan 2008 11:01:50 -0000
@@ -22,7 +22,7 @@
 #include <sys/types.h>

 /* 2-way challenge/response simple auth */
-#define DEFAULT_KEY_FILE "/etc/cluster/fence_xvm.key"
+#define DEFAULT_KEY_FILE DEFAULT_CONFIG_DIR "/fence_xvm.key"

 int read_key_file(char *, char *, size_t);
 int tcp_challenge(int, fence_auth_type_t, void *, size_t, int);
Index: fence/fenced/main.c
===================================================================
RCS file: /cvs/cluster/cluster/fence/fenced/main.c,v
retrieving revision 1.45
diff -u -r1.45 main.c
--- fence/fenced/main.c 26 Oct 2007 19:33:47 -0000      1.45
+++ fence/fenced/main.c 2 Jan 2008 11:01:50 -0000
@@ -97,7 +97,7 @@

        error = ccs_get(cd, path, &str);
        if (error)
-               die1("local cman node name \"%s\" not found in cluster.conf",
+               die1("local cman node name \"%s\" not found in the 
configuration",
                     our_name);


@@ -528,7 +528,7 @@
        printf("  -h              Print this help, then exit\n");
        printf("  -V              Print program version information, then 
exit\n");
        printf("\n");
-       printf("Command line values override those in cluster.conf.\n");
+       printf("Command line values override those in " DEFAULT_CONFIG_DIR "/" 
DEFAULT_CONFIG_FILE ".\n");
        printf("For an unbounded delay use <secs> value of -1.\n");
        printf("\n");
 }
Index: make/defines.mk.input
===================================================================
RCS file: /cvs/cluster/cluster/make/defines.mk.input,v
retrieving revision 1.9
diff -u -r1.9 defines.mk.input
--- make/defines.mk.input       20 Dec 2007 22:10:04 -0000      1.9
+++ make/defines.mk.input       2 Jan 2008 11:01:50 -0000
@@ -27,7 +27,8 @@
 AR = ar
 RANLIB = ranlib

-CFLAGS += @CFLAGS@ [EMAIL PROTECTED]@/config
+CFLAGS += @CFLAGS@ [EMAIL PROTECTED]@/config +CFLAGS += -DDEFAULT_CONFIG_DIR=\"@[EMAIL PROTECTED]" -DDEFAULT_CONFIG_FILE=\"@[EMAIL PROTECTED]"
 LDFLAGS += @LDFLAGS@

 SRCDIR = @SRCDIR@
Index: rgmanager/src/daemons/rg_locks.c
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/rg_locks.c,v
retrieving revision 1.9
diff -u -r1.9 rg_locks.c
--- rgmanager/src/daemons/rg_locks.c    27 Mar 2007 19:33:20 -0000      1.9
+++ rgmanager/src/daemons/rg_locks.c    2 Jan 2008 11:01:50 -0000
@@ -50,7 +50,7 @@

 #ifdef NO_CCS
 static xmlDocPtr ccs_doc = NULL;
-static char *conffile = "/etc/cluster/cluster.conf";
+static char *conffile = DEFAULT_CONFIG_DIR "/" DEFAULT_CONFIG_FILE;
 #endif

 int


--
I'm going to make him an offer he can't refuse.

Reply via email to