1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Make clvmd do a quick sanity check on the clustering bits of lvm.conf

This commit is contained in:
Patrick Caulfield 2005-02-02 11:42:29 +00:00
parent 28b4320c7f
commit d9656543ee
2 changed files with 28 additions and 0 deletions

View File

@ -1,6 +1,7 @@
Version 2.01.04 - Version 2.01.04 -
=================================== ===================================
Gulm clvmd doesn't report "connection refused" errors. Gulm clvmd doesn't report "connection refused" errors.
clvmd does a basic config file sanity check at startup.
Version 2.01.03 - 1st February 2005 Version 2.01.03 - 1st February 2005
=================================== ===================================

View File

@ -438,6 +438,30 @@ static void *get_initial_state()
return NULL; return NULL;
} }
/* This checks some basic cluster-LVM configuration stuff */
static void check_config()
{
int locking_type;
locking_type = find_config_int(cmd->cft->root, "global/locking_type", 1);
if (locking_type == 3) /* compiled-in cluster support */
return;
if (locking_type == 2) { /* External library, check name */
char *libname;
libname = find_config_str(cmd->cft->root, "global/locking_library",
"");
if (!strcmp(libname, "liblvm2clusterlock.so"))
return;
log_error("Incorrect LVM locking library specified in lvm.conf, cluster operations may not work.");
return;
}
log_error("locking_type not set correctly in lvm.conf, cluster operations will not work.");
}
void init_lvhash() void init_lvhash()
{ {
/* Create hash table for keeping LV locks & status */ /* Create hash table for keeping LV locks & status */
@ -457,6 +481,9 @@ int init_lvm(void)
init_syslog(LOG_DAEMON); init_syslog(LOG_DAEMON);
init_debug(_LOG_ERR); init_debug(_LOG_ERR);
/* Check lvm.conf is setup for cluster-LVM */
check_config();
get_initial_state(); get_initial_state();
return 1; return 1;