Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=f2…
Commit: f28ffc584d21fdf0c72e97ccc13a16c85e253655
Parent: 2d63f693d780f9b3ac667c3445346f5798c42537
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: Mon Jan 11 16:49:25 2010 +0100
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: Mon Jan 11 16:49:25 2010 +0100
cman init: add check for executable
based on debian idea to check if a binary is available and executable,
implement a generic check and use it around.
we do only check for our own binaries. System binaries are supposed to be
there and in a sane state (otherwise the init script would fail anyway).
Signed-off-by: Fabio M. Di Nitto <fdinitto(a)redhat.com>
---
cman/init.d/cman.in | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/cman/init.d/cman.in b/cman/init.d/cman.in
index 9caff61..1cf3366 100644
--- a/cman/init.d/cman.in
+++ b/cman/init.d/cman.in
@@ -19,8 +19,6 @@
# set secure PATH
PATH="/bin:/usr/bin:/sbin:/usr/sbin:@SBINDIR@"
-[ -x @SBINDIR@/cman_tool ] || exit 0
-
local_chkconfig()
{
case "$1" in
@@ -222,12 +220,29 @@ runwrap()
fi
}
+check_exec()
+{
+ exec=$1
+
+ realexec="$(type -p $exec)"
+ if [ -z "$realexec" ]; then
+ errmsg="Unable to find $exec in PATH"
+ return 1
+ fi
+ if [ ! -x "$realexec" ]; then
+ errmsg="$realexec not executable"
+ return 1
+ fi
+ return 0
+}
+
start_daemon()
{
daemon=$1
shift
args="$@"
+ check_exec $daemon || return $?
status $daemon > /dev/null 2>&1 && return 0
errmsg=$( $daemon $args 2>&1 )
}
@@ -505,6 +520,7 @@ stop_configfs()
start_cman()
{
+ check_exec cman_tool || return $?
cman_running && return 0
cman_checkconfig || return 1
Gitweb: http://git.fedorahosted.org/git/gfs1-utils.git?p=gfs1-utils.git;a=commitdif…
Commit: 60c67a969639d95e842c2e90a567f2c94689db70
Parent: 3f34656a829f464033c79d50e607e2936dd46030
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Jan 8 12:59:04 2010 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri Jan 8 12:59:04 2010 -0600
gfs_fsck: Don't try to convert free_meta to free if -n was specified.
The code was checking free_meta blocks and counting them as errors
even if -n was specified on gfs_fsck. But free_meta blocks aren't
technically an error and gfs_fsck's converting them to free blocks
is a convenience, so if -n was specified, don't treat them as errors.
rhbz#508978
---
gfs/gfs_fsck/pass5.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/gfs/gfs_fsck/pass5.c b/gfs/gfs_fsck/pass5.c
index d8d0768..9916664 100644
--- a/gfs/gfs_fsck/pass5.c
+++ b/gfs/gfs_fsck/pass5.c
@@ -202,10 +202,11 @@ static int check_block_status(struct fsck_sb *sbp, char *buffer, unsigned int bu
rg_status, block_status, q.block_type);
if((rg_status == GFS_BLKST_FREEMETA) &&
(block_status == GFS_BLKST_FREE)) {
- errors_found++;
- log_info("Converting free metadata block at %"
- PRIu64" to a free data block\n", block);
if(!sbp->opts->no) {
+ errors_found++;
+ log_info("Converting free metadata "
+ "block at %" PRIu64 " to a "
+ "free data block\n", block);
if(fs_set_bitmap(sbp, block, block_status)) {
log_warn("Failed to convert free metadata block to free data block at %PRIu64.\n", block);
}
@@ -214,6 +215,9 @@ static int check_block_status(struct fsck_sb *sbp, char *buffer, unsigned int bu
errors_corrected++;
}
}
+ /* If we have free_meta blocks but -n was
+ specified, we can't convert them. But it's
+ also not technically an error. */
}
else {
const char *blockstatus[] = {"Free", "Data",
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=cf…
Commit: cf9c5e17f768c02b639d57df606b7b1594eb00ab
Parent: 89bbcb2cac174e404f3b5bbf0fce4f9da7ff59f7
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Fri Jan 8 10:17:53 2010 -0600
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Fri Jan 8 10:17:53 2010 -0600
gfs_fsck: Don't try to convert free_meta to free if -n was specified.
The code was checking free_meta blocks and counting them as errors
even if -n was specified on gfs_fsck. But free_meta blocks aren't
technically an error and gfs_fsck's converting them to free blocks
is a convenience, so if -n was specified, don't treat them as errors.
rhbz#508978
---
gfs/gfs_fsck/pass5.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/gfs/gfs_fsck/pass5.c b/gfs/gfs_fsck/pass5.c
index d8d0768..9916664 100644
--- a/gfs/gfs_fsck/pass5.c
+++ b/gfs/gfs_fsck/pass5.c
@@ -202,10 +202,11 @@ static int check_block_status(struct fsck_sb *sbp, char *buffer, unsigned int bu
rg_status, block_status, q.block_type);
if((rg_status == GFS_BLKST_FREEMETA) &&
(block_status == GFS_BLKST_FREE)) {
- errors_found++;
- log_info("Converting free metadata block at %"
- PRIu64" to a free data block\n", block);
if(!sbp->opts->no) {
+ errors_found++;
+ log_info("Converting free metadata "
+ "block at %" PRIu64 " to a "
+ "free data block\n", block);
if(fs_set_bitmap(sbp, block, block_status)) {
log_warn("Failed to convert free metadata block to free data block at %PRIu64.\n", block);
}
@@ -214,6 +215,9 @@ static int check_block_status(struct fsck_sb *sbp, char *buffer, unsigned int bu
errors_corrected++;
}
}
+ /* If we have free_meta blocks but -n was
+ specified, we can't convert them. But it's
+ also not technically an error. */
}
else {
const char *blockstatus[] = {"Free", "Data",