cluster: RHEL59 - rgmanager: Don't immediately stop services that have started sucessfully
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=5a1d50a8308...
Commit: 5a1d50a8308bb5b40c6a8d990f628bdaa9c20a59
Parent: 55710722d15be8f2eafdae472086182f88b2a0d5
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Jun 28 15:24:48 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Tue Jul 10 15:56:33 2012 -0400
rgmanager: Don't immediately stop services that have started sucessfully
This patch fixes a bug that caused services to be started, then
immediately stopped during recovery. This occurred when a service
had its recovery policy set to relocate and was in a restricted
failover domain. If starting the service failed on other nodes in the
failover domain, the service would be restarted on the original node,
then immediately stopped, even if it had started successfully. This
patch causes rgmanager to leave the service running if it restarted
successfully.
Resolves: rhbz#789366
Acked-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/daemons/rg_state.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/daemons/rg_state.c b/rgmanager/src/daemons/rg_state.c
index a8b1e36..4357d21 100644
--- a/rgmanager/src/daemons/rg_state.c
+++ b/rgmanager/src/daemons/rg_state.c
@@ -2061,7 +2061,7 @@ exhausted:
svcName);
if (svc_start(svcName, RG_START_RECOVER) == 0) {
*new_owner = me;
- return RG_EFAIL;
+ return 0;
}
}
11 years, 9 months
cluster: RHEL59 - rgmanager: Don't exit uncleanly when cman asks us to shut down.
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=55710722d15...
Commit: 55710722d15be8f2eafdae472086182f88b2a0d5
Parent: df45c13985a5219c04356eea98179935ed9efb14
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Jun 28 15:18:09 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Tue Jul 10 15:55:29 2012 -0400
rgmanager: Don't exit uncleanly when cman asks us to shut down.
Original patch from Lon rediffed to apply to the current tree:
"Previous to this, rgmanager would uncleanly exit if you
issued a 'service cman stop'. This patch makes it uncleanly
exit if 'cman_tool leave force' or a corosync/openais crash
occurs, but in a simple cman_tool leave, rgmanager will no
longer exit uncleanly."
Without this patch, issuing 'service cman stop' when rgmanager
is running will make it impossible to stop the cman service because
rgmanager will have exited without releasing its dlm lockspace.
This patch causes rgmanager to refuse shutdown when requested
by cman. Users must stop the rgmanager service before stopping
the cman service.
Acked-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/clulib/msg_cluster.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/clulib/msg_cluster.c b/rgmanager/src/clulib/msg_cluster.c
index 8dc22d0..e864853 100644
--- a/rgmanager/src/clulib/msg_cluster.c
+++ b/rgmanager/src/clulib/msg_cluster.c
@@ -211,7 +211,7 @@ poll_cluster_messages(int timeout)
if (cman_dispatch(ch, 0) < 0) {
process_cman_event(ch, NULL,
- CMAN_REASON_TRY_SHUTDOWN, 0);
+ CMAN_REASON_TRY_SHUTDOWN, 1);
}
ret = 0;
}
@@ -987,6 +987,11 @@ process_cman_event(cman_handle_t handle, void *private, int reason, int arg)
printf("EVENT: %p %p %d %d\n", handle, private, reason, arg);
#endif
+ if (reason == CMAN_REASON_TRY_SHUTDOWN && !arg) {
+ cman_replyto_shutdown(handle, 0);
+ return;
+ }
+
/* Allocate queue node */
while ((node = malloc(sizeof(*node))) == NULL) {
sleep(1);
11 years, 9 months
cluster: RHEL59 - rgmanager: Fix orainstance.sh error checking
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=df45c13985a...
Commit: df45c13985a5219c04356eea98179935ed9efb14
Parent: 49c6289cd6c394f6b18d7f61f0177ed886643f14
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Jun 28 11:19:16 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Tue Jul 10 15:54:07 2012 -0400
rgmanager: Fix orainstance.sh error checking
Pull in the fixed error checking that was added to oracledb.sh as a fix for
rhbz#471066.
Resolves rhbz#723819
Acked-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/resources/orainstance.sh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rgmanager/src/resources/orainstance.sh b/rgmanager/src/resources/orainstance.sh
index 6f2ff15..a9f690d 100755
--- a/rgmanager/src/resources/orainstance.sh
+++ b/rgmanager/src/resources/orainstance.sh
@@ -105,7 +105,7 @@ start_db() {
# If we see:
# ORA-.....: failure, we failed
- grep -q "failure" $logfile
+ grep -q "^ORA-" $logfile
rv=$?
rm -f $logfile
@@ -155,7 +155,7 @@ stop_db() {
return 1
fi
- grep -q failure $logfile
+ grep -q "^ORA-" $logfile
rv=$?
rm -f $logfile
11 years, 9 months
cluster: RHEL59 - rgmanager: Fix a possible NULL pointer dereference
by Ryan McCabe
Gitweb: http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=49c6289cd6c...
Commit: 49c6289cd6c394f6b18d7f61f0177ed886643f14
Parent: 4a3415a2056b8b09ab272edefc0de8950b84f393
Author: Ryan McCabe <rmccabe(a)redhat.com>
AuthorDate: Thu Jun 28 15:50:37 2012 -0400
Committer: Ryan McCabe <rmccabe(a)redhat.com>
CommitterDate: Tue Jul 10 15:52:14 2012 -0400
rgmanager: Fix a possible NULL pointer dereference
Fix a NULL pointer dereference that could happen when cman_get_node_count()
returns 0 with errno set to EINTR.
Possibly resolves rhbz#820632
Acked-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
Signed-off-by: Ryan McCabe <rmccabe(a)redhat.com>
---
rgmanager/src/clulib/members.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/clulib/members.c b/rgmanager/src/clulib/members.c
index f705297..72f4529 100644
--- a/rgmanager/src/clulib/members.c
+++ b/rgmanager/src/clulib/members.c
@@ -367,8 +367,10 @@ get_member_list(cman_handle_t h)
do {
++tries;
- if (nodes)
+ if (nodes) {
free(nodes);
+ nodes = NULL;
+ }
c = cman_get_node_count(h);
if (c <= 0) {
11 years, 9 months
gfs2-utils: master - gfs2-utils: Remove unused exported functions
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=aaa9d0c9...
Commit: aaa9d0c9f75936ef8cc19d8cfc4f48f8b4bfdd59
Parent: 3b748462ec98cb5909b3ad9f3b639dbca38142fd
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jul 4 14:58:18 2012 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Jul 4 14:58:18 2012 +0100
gfs2-utils: Remove unused exported functions
These symbols are now unused within the gfs2-utils tree:
$ findunused.sh | grep -v '^group/'
gfs2/libgfs2/libgfs2.h:712 find_debugfs_mount
gfs2/libgfs2/misc.c:314 find_debugfs_mount
gfs2/libgfs2/libgfs2.h:395 gfs2_bitcount
gfs2/libgfs2/fs_bits.c:109 gfs2_bitcount
gfs2/libgfs2/libgfs2.h:835 gfs2_dirent_print
gfs2/libgfs2/ondisk.c:418 gfs2_dirent_print
gfs2/libgfs2/libgfs2.h:810 gfs2_ea_header_out
gfs2/libgfs2/ondisk.c:481 gfs2_ea_header_out
gfs2/libgfs2/fs_ops.c:1371 init_gfs_dinode
gfs2/libgfs2/libgfs2.h:451 init_gfs_dinode
gfs2/libgfs2/libgfs2.h:713 mp2fsname
gfs2/libgfs2/misc.c:365 mp2fsname
gfs2/libgfs2/libgfs2.h:705 get_sysfs
gfs2/libgfs2/misc.c:273 get_sysfs
So it's safe to remove them. The idea is to simplify libgfs2 for now but
if these are required in future they can be brought back.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
gfs2/libgfs2/fs_bits.c | 32 ------------
gfs2/libgfs2/fs_ops.c | 8 ---
gfs2/libgfs2/libgfs2.h | 12 -----
gfs2/libgfs2/misc.c | 124 ------------------------------------------------
gfs2/libgfs2/ondisk.c | 28 -----------
5 files changed, 0 insertions(+), 204 deletions(-)
diff --git a/gfs2/libgfs2/fs_bits.c b/gfs2/libgfs2/fs_bits.c
index d3ac048..5eeb920 100644
--- a/gfs2/libgfs2/fs_bits.c
+++ b/gfs2/libgfs2/fs_bits.c
@@ -98,38 +98,6 @@ unsigned long gfs2_bitfit(const unsigned char *buf, const unsigned int len,
return (((const unsigned char *)ptr - buf) * GFS2_NBBY) + bit;
}
-/**
- * fs_bitcount - count the number of bits in a certain state
- * @buffer: the buffer that holds the bitmaps
- * @buflen: the length (in bytes) of the buffer
- * @state: the state of the block we're looking for
- *
- * Returns: The number of bits
- */
-uint32_t gfs2_bitcount(unsigned char *buffer, unsigned int buflen,
- unsigned char state)
-{
- unsigned char *byte, *end;
- unsigned int bit;
- uint32_t count = 0;
-
- byte = buffer;
- bit = 0;
- end = buffer + buflen;
-
- while (byte < end){
- if (((*byte >> bit) & GFS2_BIT_MASK) == state)
- count++;
-
- bit += GFS2_BIT_SIZE;
- if (bit >= 8){
- bit = 0;
- byte++;
- }
- }
- return count;
-}
-
/*
* check_range - check if blkno is within FS limits
* @sdp: super block
diff --git a/gfs2/libgfs2/fs_ops.c b/gfs2/libgfs2/fs_ops.c
index 470916c..9409332 100644
--- a/gfs2/libgfs2/fs_ops.c
+++ b/gfs2/libgfs2/fs_ops.c
@@ -1368,14 +1368,6 @@ struct gfs2_buffer_head *init_dinode(struct gfs2_sbd *sdp,
return __init_dinode(sdp, inum, mode, flags, parent, 0);
}
-struct gfs2_buffer_head *init_gfs_dinode(struct gfs2_sbd *sdp,
- struct gfs2_inum *inum,
- unsigned int mode, uint32_t flags,
- struct gfs2_inum *parent)
-{
- return __init_dinode(sdp, inum, mode, flags, parent, 1);
-}
-
static struct gfs2_inode *__createi(struct gfs2_inode *dip,
const char *filename, unsigned int mode,
uint32_t flags, int if_gfs1)
diff --git a/gfs2/libgfs2/libgfs2.h b/gfs2/libgfs2/libgfs2.h
index 2fc47de..09f0b1d 100644
--- a/gfs2/libgfs2/libgfs2.h
+++ b/gfs2/libgfs2/libgfs2.h
@@ -392,8 +392,6 @@ extern void fix_device_geometry(struct gfs2_sbd *sdp);
#define BFITNOENT (0xFFFFFFFF)
/* functions with blk #'s that are buffer relative */
-extern uint32_t gfs2_bitcount(unsigned char *buffer, unsigned int buflen,
- unsigned char state);
extern unsigned long gfs2_bitfit(const unsigned char *buffer,
const unsigned int buflen,
unsigned long goal, unsigned char old_state);
@@ -448,11 +446,6 @@ extern struct gfs2_buffer_head *init_dinode(struct gfs2_sbd *sdp,
struct gfs2_inum *inum,
unsigned int mode, uint32_t flags,
struct gfs2_inum *parent);
-extern struct gfs2_buffer_head *init_gfs_dinode(struct gfs2_sbd *sdp,
- struct gfs2_inum *inum,
- unsigned int mode,
- uint32_t flags,
- struct gfs2_inum *parent);
extern struct gfs2_inode *createi(struct gfs2_inode *dip, const char *filename,
unsigned int mode, uint32_t flags);
extern struct gfs2_inode *gfs_createi(struct gfs2_inode *dip,
@@ -709,9 +702,6 @@ extern int dir_exists(const char *dir);
extern int check_for_gfs2(struct gfs2_sbd *sdp);
extern int mount_gfs2_meta(struct gfs2_sbd *sdp);
extern void cleanup_metafs(struct gfs2_sbd *sdp);
-extern char *find_debugfs_mount(void);
-extern char *mp2fsname(char *mp);
-extern char *get_sysfs(const char *fsname, const char *filename);
extern int set_sysfs(const char *fsname, const char *filename, const char *val);
extern int is_fsname(char *name);
extern void get_random_bytes(void *buf, int nbytes);
@@ -807,7 +797,6 @@ extern void gfs2_dirent_out(struct gfs2_dirent *de, char *buf);
extern void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh);
extern void gfs2_leaf_out(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh);
extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf);
-extern void gfs2_ea_header_out(struct gfs2_ea_header *ea, char *buf);
extern void gfs2_log_header_in(struct gfs2_log_header *lh,
struct gfs2_buffer_head *bh);
extern void gfs2_log_header_out(struct gfs2_log_header *lh,
@@ -832,7 +821,6 @@ extern void gfs2_rindex_print(struct gfs2_rindex *ri);
extern void gfs2_rgrp_print(struct gfs2_rgrp *rg);
extern void gfs2_quota_print(struct gfs2_quota *qu);
extern void gfs2_dinode_print(struct gfs2_dinode *di);
-extern void gfs2_dirent_print(struct gfs2_dirent *de, char *name);
extern void gfs2_leaf_print(struct gfs2_leaf *lf);
extern void gfs2_ea_header_print(struct gfs2_ea_header *ea, char *name);
extern void gfs2_log_header_print(struct gfs2_log_header *lh);
diff --git a/gfs2/libgfs2/misc.c b/gfs2/libgfs2/misc.c
index 13ef972..a68da4a 100644
--- a/gfs2/libgfs2/misc.c
+++ b/gfs2/libgfs2/misc.c
@@ -248,42 +248,6 @@ void cleanup_metafs(struct gfs2_sbd *sdp)
rmdir(sdp->metafs_path);
}
-static char *__get_sysfs(const char *fsname, const char *filename)
-{
- char path[PATH_MAX];
- int fd, rv;
-
- memset(path, 0, PATH_MAX);
- memset(sysfs_buf, 0, PAGE_SIZE);
- snprintf(path, PATH_MAX - 1, "%s/%s/%s", SYS_BASE, fsname, filename);
-
- fd = open(path, O_RDONLY);
- if (fd < 0)
- return NULL;
- rv = read(fd, sysfs_buf, PAGE_SIZE);
- if (rv < 0) {
- close(fd);
- return NULL;
- }
-
- close(fd);
- return sysfs_buf;
-}
-
-char *get_sysfs(const char *fsname, const char *filename)
-{
- char *s;
- char *p;
-
- s = __get_sysfs(fsname, filename);
- if (!s)
- return NULL;
- p = strchr(s, '\n');
- if (p)
- *p = '\0';
- return sysfs_buf;
-}
-
int set_sysfs(const char *fsname, const char *filename, const char *val)
{
char path[PATH_MAX];
@@ -311,94 +275,6 @@ int set_sysfs(const char *fsname, const char *filename, const char *val)
return 0;
}
-char *find_debugfs_mount(void)
-{
- FILE *file;
- char line[PATH_MAX];
- char device[PATH_MAX], type[PATH_MAX];
- char *path;
-
- file = fopen("/proc/mounts", "rt");
- if (!file)
- return NULL;
-
- path = malloc(PATH_MAX);
- if (!path) {
- fclose(file);
- return NULL;
- }
- while (fgets(line, PATH_MAX, file)) {
-
- if (sscanf(line, "%s %s %s", device, path, type) != 3)
- continue;
- if (!strcmp(type, "debugfs")) {
- fclose(file);
- return path;
- }
- }
-
- free(path);
- fclose(file);
- return NULL;
-}
-
-/**
- * mp2fsname - Find the name for a filesystem given its mountpoint
- *
- * We do this by iterating through gfs2 dirs in /sys/fs/gfs2/ looking for
- * one where the "id" attribute matches the device id returned by stat for
- * the mount point. The reason we go through all this is simple: the
- * kernel's sysfs is named after the VFS s_id, not the device name.
- * So it's perfectly legal to do something like this to simulate user
- * conditions without the proper hardware:
- * # rm /dev/sdb1
- * # mkdir /dev/cciss
- * # mknod /dev/cciss/c0d0p1 b 8 17
- * # mount -tgfs2 /dev/cciss/c0d0p1 /mnt/gfs2
- * # gfs2_tool gettune /mnt/gfs2
- * In this example the tuning variables are in a directory named after the
- * VFS s_id, which in this case would be /sys/fs/gfs2/sdb1/
- *
- * Returns: the fsname
- */
-
-char *mp2fsname(char *mp)
-{
- char device_id[PATH_MAX], *fsname = NULL;
- struct stat statbuf;
- DIR *d;
- struct dirent *de;
- char *id;
-
- if (stat(mp, &statbuf))
- return NULL;
-
- memset(device_id, 0, sizeof(device_id));
- sprintf(device_id, "%i:%i", major(statbuf.st_dev),
- minor(statbuf.st_dev));
-
- d = opendir(SYS_BASE);
- if (!d)
- return NULL;
-
- while ((de = readdir(d))) {
- if (de->d_name[0] == '.')
- continue;
-
- id = get_sysfs(de->d_name, "id");
- if (!id)
- continue;
- if (strcmp(id, device_id) == 0) {
- fsname = strdup(de->d_name);
- break;
- }
- }
-
- closedir(d);
-
- return fsname;
-}
-
/*
* get_random_bytes - Generate a series of random bytes using /dev/urandom.
*
diff --git a/gfs2/libgfs2/ondisk.c b/gfs2/libgfs2/ondisk.c
index 73b2b0f..301d92d 100644
--- a/gfs2/libgfs2/ondisk.c
+++ b/gfs2/libgfs2/ondisk.c
@@ -415,21 +415,6 @@ void gfs2_dirent_out(struct gfs2_dirent *de, char *buf)
memset(str->__pad, 0, sizeof(str->__pad));
}
-void gfs2_dirent_print(struct gfs2_dirent *de, char *name)
-{
- char buf[GFS2_FNAMESIZE + 1];
-
- gfs2_inum_print(&de->de_inum);
- pv(de, de_hash, "0x%.8X", NULL);
- pv(de, de_rec_len, "%u", "0x%x");
- pv(de, de_name_len, "%u", "0x%x");
- pv(de, de_type, "%u", "0x%x");
-
- memset(buf, 0, GFS2_FNAMESIZE + 1);
- memcpy(buf, name, de->de_name_len);
- print_it(" name", "%s", NULL, buf);
-}
-
void gfs2_leaf_in(struct gfs2_leaf *lf, struct gfs2_buffer_head *bh)
{
struct gfs2_leaf *str = (struct gfs2_leaf *)bh->b_data;
@@ -478,19 +463,6 @@ void gfs2_ea_header_in(struct gfs2_ea_header *ea, char *buf)
ea->ea_num_ptrs = str->ea_num_ptrs;
}
-void gfs2_ea_header_out(struct gfs2_ea_header *ea, char *buf)
-{
- struct gfs2_ea_header *str = (struct gfs2_ea_header *)buf;
-
- CPOUT_32(ea, str, ea_rec_len);
- CPOUT_32(ea, str, ea_data_len);
- str->ea_name_len = ea->ea_name_len;
- str->ea_type = ea->ea_type;
- str->ea_flags = ea->ea_flags;
- str->ea_num_ptrs = ea->ea_num_ptrs;
- str->__pad = 0;
-}
-
void gfs2_ea_header_print(struct gfs2_ea_header *ea, char *name)
{
char buf[GFS2_EA_MAX_NAME_LEN + 1];
11 years, 10 months
gfs2-utils: master - gfs2-utils: Only build group/ when gfs_controld is enabled
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=3b748462...
Commit: 3b748462ec98cb5909b3ad9f3b639dbca38142fd
Parent: 69b7a79e053aecaf7218134b8536bc0d7332a17e
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Wed Jul 4 12:30:15 2012 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Wed Jul 4 12:30:15 2012 +0100
gfs2-utils: Only build group/ when gfs_controld is enabled
The previous commit only disabled gfs_controld from building when
--enable-gfs_controld was omitted. When we're not building gfs_controld
there really is no reason to build anything else in the group/ directory
so this patch disables it by default.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
Makefile.am | 6 +++++-
group/Makefile.am | 6 +-----
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 2e5d9ae..0af3e04 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,7 +12,11 @@ noinst_HEADERS = make/copyright.cf
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = po group gfs2 doc
+if BUILD_GFS_CONTROLD
+DIR_GROUP = group
+endif
+
+SUBDIRS = po $(DIR_GROUP) gfs2 doc
install-exec-local:
$(INSTALL) -d $(DESTDIR)/$(LOGDIR)
diff --git a/group/Makefile.am b/group/Makefile.am
index 2904ce1..5b7d0f8 100644
--- a/group/Makefile.am
+++ b/group/Makefile.am
@@ -1,7 +1,3 @@
MAINTAINERCLEANFILES = Makefile.in
-if BUILD_GFS_CONTROLD
-DIR_GFS_CONTROLD = gfs_controld
-endif
-
-SUBDIRS = libgfscontrol gfs_control $(DIR_GFS_CONTROLD) man include
+SUBDIRS = libgfscontrol gfs_control gfs_controld man include
11 years, 10 months
gfs2-utils: master - gfs2-utils: Make building gfs_controld optional
by Andrew Price
Gitweb: http://git.fedorahosted.org/git/?p=gfs2-utils.git;a=commitdiff;h=69b7a79e...
Commit: 69b7a79e053aecaf7218134b8536bc0d7332a17e
Parent: 46388807a62c24e4156584481f7df5eb7c8620cd
Author: Andrew Price <anprice(a)redhat.com>
AuthorDate: Tue Jul 3 18:54:27 2012 +0100
Committer: Andrew Price <anprice(a)redhat.com>
CommitterDate: Tue Jul 3 19:02:53 2012 +0100
gfs2-utils: Make building gfs_controld optional
As of Fedora 17 gfs_controld isn't required and also doesn't build. This
patch adds an --enable-gfs_controld option to allow it to be built on
older systems while defaulting to future norm of not building it.
Signed-off-by: Andrew Price <anprice(a)redhat.com>
---
README.build | 6 ++++++
configure.ac | 27 ++++++++++++++++++---------
group/Makefile.am | 6 +++++-
3 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/README.build b/README.build
index 007f2d7..27e022a 100644
--- a/README.build
+++ b/README.build
@@ -21,6 +21,12 @@ Plus the following libraries:
- libcfg
- openaislib
+By default gfs_controld is not built as it is not required in Fedora 17 and
+later and cannot build on it. To re-enable it for older systems, use
+--enable-gfs_controld when running the configure script (see below). The
+library dependencies for gfs_controld are only required when this option is
+given.
+
Run the following commands:
./autogen.sh
diff --git a/configure.ac b/configure.ac
index 570f826..d56cfac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,6 +95,10 @@ AC_ARG_ENABLE([debug],
[ --enable-debug enable debug build. ],
[ default="no" ])
+AC_ARG_ENABLE([gfs_controld],
+ [ --enable-gfs_controld build gfs_controld. ],
+ [ default="no" ])
+
AC_ARG_WITH([syslogfacility],
[ --syslogfacility=FACILITY
cluster default syslog facility. ],
@@ -114,15 +118,20 @@ AC_ARG_WITH([kernel],
KERNEL_CPPFLAGS="-I$KERNEL_DIR/include"
-PKG_CHECK_MODULES([corosync],[corosync])
-PKG_CHECK_MODULES([cpg],[libcpg])
-PKG_CHECK_MODULES([sackpt],[libSaCkpt])
-PKG_CHECK_MODULES([logt],[liblogthread])
-PKG_CHECK_MODULES([ccs],[libccs])
-PKG_CHECK_MODULES([cfg],[libcfg])
-PKG_CHECK_MODULES([fenced],[libfenced])
-PKG_CHECK_MODULES([dlmcontrol],[libdlmcontrol])
-PKG_CHECK_MODULES([quorum],[libquorum])
+# gfs_controld isn't required in the latest versions of cluster
+AM_CONDITIONAL([BUILD_GFS_CONTROLD], [test "x$enable_gfs_controld" = "xyes"])
+AS_IF([test "x$enable_gfs_controld" = "xyes"], [
+ PKG_CHECK_MODULES([corosync],[corosync])
+ PKG_CHECK_MODULES([cpg],[libcpg])
+ PKG_CHECK_MODULES([sackpt],[libSaCkpt])
+ PKG_CHECK_MODULES([logt],[liblogthread])
+ PKG_CHECK_MODULES([ccs],[libccs])
+ PKG_CHECK_MODULES([cfg],[libcfg])
+ PKG_CHECK_MODULES([fenced],[libfenced])
+ PKG_CHECK_MODULES([dlmcontrol],[libdlmcontrol])
+ PKG_CHECK_MODULES([quorum],[libquorum])
+])
+
PKG_CHECK_MODULES([zlib],[zlib])
# old versions of ncurses don't ship pkg-config files
diff --git a/group/Makefile.am b/group/Makefile.am
index 5b7d0f8..2904ce1 100644
--- a/group/Makefile.am
+++ b/group/Makefile.am
@@ -1,3 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
-SUBDIRS = libgfscontrol gfs_control gfs_controld man include
+if BUILD_GFS_CONTROLD
+DIR_GFS_CONTROLD = gfs_controld
+endif
+
+SUBDIRS = libgfscontrol gfs_control $(DIR_GFS_CONTROLD) man include
11 years, 10 months