cluster: RHEL6 - fence_wti: support non-default TCP ports
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: c3d9629bd1d8d3ce9dce942624c3c6112eab6ee9
Parent: 16cd1902fbbcae8c37c212099b9384ec30b2f376
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Jun 18 16:26:57 2010 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jun 18 16:49:09 2010 +0200
fence_wti: support non-default TCP ports
WTI do not use standard process to login so it needs special patch
(based on the code in library)
Resolves: rhbz#593726
---
fence/agents/wti/fence_wti.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index 81c0ab9..a71852a 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -76,7 +76,7 @@ def main():
device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
"action", "ipaddr", "login", "passwd", "passwd_script",
"cmd_prompt", "secure", "identity_file", "port", "no_login", "no_password",
- "test", "separator", "inet4_only", "inet6_only",
+ "test", "separator", "inet4_only", "inet6_only", "ipport",
"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
atexit.register(atexit_handler)
@@ -107,7 +107,9 @@ is running because the connection will block any necessary fencing actions."
if 0 == options.has_key("-x"):
try:
try:
- conn = fspawn('%s %s' % (TELNET_PATH, options["-a"]))
+ conn = fspawn(TELNET_PATH)
+ conn.send("set binary\n")
+ conn.send("open %s -%s\n"%(options["-a"], options["-u"]))
except pexpect.ExceptionPexpect, ex:
sys.stderr.write(str(ex) + "\n")
sys.stderr.write("Due to limitations, binary dependencies on fence agents "
13 years, 10 months
cluster: STABLE3 - fence_wti: support non-default TCP ports
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 713884260072bfd1118fb5c29bac7196d7a17e75
Parent: 58dae2d17bbe8bebb36dfbfc3e75c76ce09a118d
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Jun 18 16:26:57 2010 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jun 18 16:26:57 2010 +0200
fence_wti: support non-default TCP ports
WTI do not use standard process to login so it needs special patch
(based on the code in library)
Resolves: rhbz#593726
---
fence/agents/wti/fence_wti.py | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fence/agents/wti/fence_wti.py b/fence/agents/wti/fence_wti.py
index 81c0ab9..a71852a 100644
--- a/fence/agents/wti/fence_wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -76,7 +76,7 @@ def main():
device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug",
"action", "ipaddr", "login", "passwd", "passwd_script",
"cmd_prompt", "secure", "identity_file", "port", "no_login", "no_password",
- "test", "separator", "inet4_only", "inet6_only",
+ "test", "separator", "inet4_only", "inet6_only", "ipport",
"power_timeout", "shell_timeout", "login_timeout", "power_wait" ]
atexit.register(atexit_handler)
@@ -107,7 +107,9 @@ is running because the connection will block any necessary fencing actions."
if 0 == options.has_key("-x"):
try:
try:
- conn = fspawn('%s %s' % (TELNET_PATH, options["-a"]))
+ conn = fspawn(TELNET_PATH)
+ conn.send("set binary\n")
+ conn.send("open %s -%s\n"%(options["-a"], options["-u"]))
except pexpect.ExceptionPexpect, ex:
sys.stderr.write(str(ex) + "\n")
sys.stderr.write("Due to limitations, binary dependencies on fence agents "
13 years, 10 months
cluster: RHEL56 - fence: Build problem in fence_vmware_helper
by Marek Grác
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: f4fc5eb9e0b848a11c5e06a32ea97d51e1beca5d
Parent: 49d3da55baca52545da914d5682a64f8ffa44ed1
Author: Marek 'marx' Grac <mgrac(a)redhat.com>
AuthorDate: Fri Jun 18 09:23:31 2010 +0200
Committer: Marek 'marx' Grac <mgrac(a)redhat.com>
CommitterDate: Fri Jun 18 09:23:31 2010 +0200
fence: Build problem in fence_vmware_helper
My changes to Makefiles makes a wrong assumption that both scripts for
vmware are python based what leads to improper version filling.
Patch proposed by Honza
Resolves: rhbz#590304
---
fence/agents/vmware/Makefile | 6 +++---
fence/agents/vmware/fence_vmware_helper.pl | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/fence/agents/vmware/Makefile b/fence/agents/vmware/Makefile
index f0259b8..1795e63 100644
--- a/fence/agents/vmware/Makefile
+++ b/fence/agents/vmware/Makefile
@@ -34,9 +34,9 @@ $(TARGET): $(SOURCE)
$(TARGET2): $(SOURCE2)
: > $(TARGET2)
awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE2) >> $(TARGET2)
- echo "FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET2)
- ${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf sh REDHAT_COPYRIGHT >> $(TARGET2)
- echo "BUILD_DATE=\"(built `date`)\";" >> $(TARGET2)
+ echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET2)
+ ${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET2)
+ echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET2)
awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE2) >> $(TARGET2)
chmod +x $(TARGET2)
diff --git a/fence/agents/vmware/fence_vmware_helper.pl b/fence/agents/vmware/fence_vmware_helper.pl
index a0b5cea..b2ace50 100644
--- a/fence/agents/vmware/fence_vmware_helper.pl
+++ b/fence/agents/vmware/fence_vmware_helper.pl
@@ -12,7 +12,7 @@ END {
$? ||= 1;
}
-my ($RELEASE_VERSION, $REDHAT_COPYRIGHT, $BUILD_DATE);
+my ($FENCE_RELEASE_NAME, $REDHAT_COPYRIGHT, $BUILD_DATE);
#BEGIN_VERSION_GENERATION
$RELEASE_VERSION="";
13 years, 10 months
cluster: RHEL4 - NFS over GFS problem - invalid metadata block
by Bob Peterson
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e6c22884192ff33724b8fd17bf1a040f6210f666
Parent: bba9068b91f737b8f88cd26581eed5884f443bae
Author: Bob Peterson <rpeterso(a)redhat.com>
AuthorDate: Thu Jun 17 11:16:30 2010 -0500
Committer: Bob Peterson <rpeterso(a)redhat.com>
CommitterDate: Thu Jun 17 11:16:30 2010 -0500
NFS over GFS problem - invalid metadata block
This patch fixes a problem whereby GFS read-ahead was interfering
with GFS write requests by continuously re-trying the read-aheads.
The patch reduces the extra read-aheads so that the read-ahead for
each block is only done once for any given write request.
rhbz#515267
---
gfs-kernel/src/gfs/dio.c | 12 ++++++++----
gfs-kernel/src/gfs/dio.h | 2 +-
gfs-kernel/src/gfs/file.c | 12 +++++++++---
3 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/gfs-kernel/src/gfs/dio.c b/gfs-kernel/src/gfs/dio.c
index 595ad57..ddf9df2 100644
--- a/gfs-kernel/src/gfs/dio.c
+++ b/gfs-kernel/src/gfs/dio.c
@@ -1186,21 +1186,22 @@ gfs_get_data_buffer(struct gfs_inode *ip, uint64_t block, int new,
* @dblock: the starting disk block
* @extlen: the number of blocks in the extent
*
+ * returns: number of blocks for which it submitted read requests.
*/
-void
+int
gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen)
{
struct gfs_sbd *sdp = gl->gl_sbd;
struct inode *aspace = gl->gl_aspace;
struct buffer_head *first_bh, *bh;
uint32_t max_ra = gfs_tune_get(sdp, gt_max_readahead) >> sdp->sd_sb.sb_bsize_shift;
- int error;
+ int error, submitted = 0;
if (!extlen)
- return;
+ return 0;
if (!max_ra)
- return;
+ return 0;
if (extlen > max_ra)
extlen = max_ra;
@@ -1210,6 +1211,7 @@ gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen)
goto out;
if (!buffer_locked(first_bh)) {
error = gfs_dreread(sdp, first_bh, DIO_START);
+ submitted++;
if (error)
goto out;
}
@@ -1222,6 +1224,7 @@ gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen)
if (!buffer_uptodate(bh) && !buffer_locked(bh)) {
error = gfs_dreread(sdp, bh, DIO_START);
+ submitted++;
brelse(bh);
if (error)
goto out;
@@ -1237,4 +1240,5 @@ gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen)
out:
brelse(first_bh);
+ return submitted;
}
diff --git a/gfs-kernel/src/gfs/dio.h b/gfs-kernel/src/gfs/dio.h
index 3836d3a..d5d0beb 100644
--- a/gfs-kernel/src/gfs/dio.h
+++ b/gfs-kernel/src/gfs/dio.h
@@ -75,7 +75,7 @@ int gfs_get_meta_buffer(struct gfs_inode *ip, int height, uint64_t num, int new,
struct buffer_head **bhp);
int gfs_get_data_buffer(struct gfs_inode *ip, uint64_t block, int new,
struct buffer_head **bhp);
-void gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen);
+int gfs_start_ra(struct gfs_glock *gl, uint64_t dblock, uint32_t extlen);
static __inline__ int
gfs_get_inode_buffer(struct gfs_inode *ip, struct buffer_head **bhp)
diff --git a/gfs-kernel/src/gfs/file.c b/gfs-kernel/src/gfs/file.c
index baec849..925a814 100644
--- a/gfs-kernel/src/gfs/file.c
+++ b/gfs-kernel/src/gfs/file.c
@@ -313,7 +313,7 @@ gfs_writei(struct gfs_inode *ip, void *buf,
struct buffer_head *dibh, *bh;
uint64_t lblock, dblock;
unsigned int o;
- uint32_t extlen = 0;
+ uint32_t extlen = 0, blocks_ra = 0;
unsigned int amount;
int new;
int journaled = gfs_is_jdata(ip);
@@ -355,6 +355,7 @@ gfs_writei(struct gfs_inode *ip, void *buf,
error = gfs_block_map(ip, lblock, &new, &dblock, &extlen);
if (error)
goto fail;
+ blocks_ra = 0;
} else {
new = FALSE;
dblock = ip->i_num.no_addr;
@@ -362,8 +363,13 @@ gfs_writei(struct gfs_inode *ip, void *buf,
}
}
- if (journaled && extlen > 1)
- gfs_start_ra(ip->i_gl, dblock, extlen);
+ if (journaled && extlen > 1) {
+ if (!blocks_ra)
+ blocks_ra = gfs_start_ra(ip->i_gl, dblock,
+ extlen);
+ if (blocks_ra)
+ blocks_ra--;
+ }
error = gfs_get_data_buffer(ip, dblock,
(amount == sdp->sd_sb.sb_bsize) ? TRUE : new,
13 years, 10 months
cluster: RHEL48 - rgmanager: Kill processes correctly w/ force_unmount
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 26a1b3ec5c6831fda8e46f5e0ff133c5605f91eb
Parent: 458ed7e8c9801db88aa741ab6473ef7512612f90
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Wed Apr 14 17:29:54 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Jun 14 16:18:47 2010 -0400
rgmanager: Kill processes correctly w/ force_unmount
The killMountProcesses function was written about 10 years ago.
It was designed to work with lsof or fuser, and to log messages
for each process killed. This is not a bad idea. The problem
is that parsing the output of either is and error-prone,
particularly when mountpoints are similar to other directories
on the system.
A far less error-prone method to cleaning up a mount point is to
use 'fuser -kvm' on it. Not only is this less error-prone, it's
a good bit faster at doing its job than iterating through output
in a shell script.
This patch makes force_unmount very reliable at killing the correct
processes, but we lose the logging functionality. It is a fair
trade-off because there have been several bugs in the
killMountProcesses function over the years which have caused several
problems.
Resolves: bz555901 bz572248
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/clusterfs.sh | 113 +--------------------------
rgmanager/src/resources/fs.sh | 140 +++++-----------------------------
rgmanager/src/resources/netfs.sh | 128 +++----------------------------
3 files changed, 37 insertions(+), 344 deletions(-)
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
index bf2a3d1..3ca7a30 100755
--- a/rgmanager/src/resources/clusterfs.sh
+++ b/rgmanager/src/resources/clusterfs.sh
@@ -492,113 +492,6 @@ isAlive()
#
-# killMountProcesses device mount_point
-#
-# Using lsof or fuser try to unmount the mount by killing of the processes
-# that might be keeping it busy.
-#
-killMountProcesses()
-{
- typeset -i ret=$SUCCESS
- typeset have_lsof=""
- typeset have_fuser=""
- typeset try
-
- if [ $# -ne 1 ]; then
- ocf_log err \
- "Usage: killMountProcesses mount_point"
- return $FAIL
- fi
-
- typeset mp=$1
-
- ocf_log notice "Forcefully unmounting $mp"
-
- #
- # Not all distributions have lsof. If not use fuser. If it
- # does, try both.
- #
- file=$(which lsof 2>/dev/null)
- if [ -f "$file" ]; then
- have_lsof=$YES
- fi
-
- file=$(which fuser 2>/dev/null)
- if [ -f "$file" ]; then
- have_fuser=$YES
- fi
-
- if [ -z "$have_lsof" -a -z "$have_fuser" ]; then
- ocf_log warn \
- "Cannot forcefully unmount $mp; cannot find lsof or fuser commands"
- return $FAIL
- fi
-
- for try in 1 2 3; do
- if [ -n "$have_lsof" ]; then
- #
- # Use lsof to free up mount point
- #
- while read command pid user
- do
- if [ -z "$pid" ]; then
- continue
- fi
-
- if [ $try -eq 1 ]; then
- ocf_log warn \
- "killing process $pid ($user $command $mp)"
- elif [ $try -eq 3 ]; then
- ocf_log crit \
- "Could not clean up mountpoint $mp"
- ret=$FAIL
- fi
-
- if [ $try -gt 1 ]; then
- kill -9 $pid
- else
- kill -TERM $pid
- fi
- done < <(lsof -b 2>/dev/null | \
- grep -E "$mp(/.*|)\$" | \
- awk '{print $1,$2,$3}' | \
- sort -u -k 1,3)
- elif [ -n "$have_fuser" ]; then
- #
- # Use fuser to free up mount point
- #
- while read command pid user
- do
- if [ -z "$pid" ]; then
- continue
- fi
-
- if [ $try -eq 1 ]; then
- ocf_log warn \
- "killing process $pid ($user $command $mp)"
- elif [ $try -eq 3 ]; then
- ocf_log crit \
- "Could not clean up mount point $mp"
- ret=$FAIL
- fi
-
- if [ $try -gt 1 ]; then
- kill -9 $pid
- else
- kill -TERM $pid
- fi
- done < <(fuser -vm $mp | \
- grep -v PID | \
- sed 's;^'$mp';;' | \
- awk '{print $4,$2,$1}' | \
- sort -u -k 1,3)
- fi
- done
-
- return $ret
-}
-
-#
# startFilesystem
#
startFilesystem() {
@@ -880,7 +773,11 @@ stop: Could not match $OCF_RESKEY_device with a real device"
umount_failed=yes
if [ "$force_umount" ]; then
- killMountProcesses $mp
+ if [ $try -eq 1 ]; then
+ fuser -TERM -kvm "$mp"
+ else
+ fuser -kvm "$mp"
+ fi
fi
if [ $try -ge $max_tries ]; then
diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index 5b3a3bc..e438894 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -570,6 +570,8 @@ isMounted () {
typeset mp tmp_mp
typeset dev tmp_dev
typeset ret=$FAIL
+ typeset found=1
+ typeset poss_mp
if [ $# -ne 2 ]; then
ocf_log err "Usage: isMounted device mount_point"
@@ -581,7 +583,7 @@ isMounted () {
if [ -z "$dev" ]; then
ocf_log err \
"fs (isMounted): Could not match $1 with a real device"
- return $FAIL
+ return $OCF_ERR_ARGS
fi
if [ -h "$2" ]; then
@@ -607,14 +609,21 @@ isMounted () {
# Check to see if its mounted in the right
# place
#
- if [ -n "$tmp_mp" -a "$tmp_mp" != "$mp" ]; then
- ocf_log warn \
-"Device $dev is mounted on $tmp_mp instead of $mp"
+ if [ -n "$tmp_mp" ]; then
+ if [ "$tmp_mp" != "$mp" ]; then
+ poss_mp=$tmp_mp
+ else
+ found=0
+ fi
fi
ret=$YES
fi
done < /proc/mounts
+ if [ $ret -eq $YES ] && [ $found -ne 0 ]; then
+ ocf_log warn "Device $dev is mounted on $poss_mp instead of $mp"
+ fi
+
return $ret
}
@@ -679,114 +688,6 @@ isAlive()
#
-# killMountProcesses mount_point
-#
-# Using lsof or fuser try to unmount the mount by killing of the processes
-# that might be keeping it busy.
-#
-killMountProcesses()
-{
- typeset -i ret=$SUCCESS
- typeset have_lsof=""
- typeset have_fuser=""
- typeset try
-
- if [ $# -ne 1 ]; then
- ocf_log err \
- "Usage: killMountProcesses mount_point"
- return $FAIL
- fi
-
- typeset mp=$1
-
- ocf_log notice "Forcefully unmounting $mp"
-
- #
- # Not all distributions have lsof. If not use fuser. If it
- # does, try both.
- #
- file=$(which lsof 2>/dev/null)
- if [ -f "$file" ]; then
- have_lsof=$YES
- fi
-
- file=$(which fuser 2>/dev/null)
- if [ -f "$file" ]; then
- have_fuser=$YES
- fi
-
- if [ -z "$have_lsof" -a -z "$have_fuser" ]; then
- ocf_log warn \
- "Cannot forcefully unmount $mp; cannot find lsof or fuser commands"
- return $FAIL
- fi
-
- for try in 1 2 3; do
- if [ -n "$have_lsof" ]; then
- #
- # Use lsof to free up mount point
- #
- while read command pid user
- do
- if [ -z "$pid" ]; then
- continue
- fi
-
- if [ $try -eq 1 ]; then
- ocf_log warn \
- "killing process $pid ($user $command $mp)"
- elif [ $try -eq 3 ]; then
- ocf_log crit \
- "Could not clean up mountpoint $mp"
- ret=$FAIL
- fi
-
- if [ $try -gt 1 ]; then
- kill -9 $pid
- else
- kill -TERM $pid
- fi
- done < <(lsof -bn 2>/dev/null | \
- grep -E "$mp(/.*|)\$" | \
- awk '{print $1,$2,$3}' | \
- sort -u -k 1,3)
- elif [ -n "$have_fuser" ]; then
- #
- # Use fuser to free up mount point
- #
- while read command pid user
- do
- if [ -z "$pid" ]; then
- continue
- fi
-
- if [ $try -eq 1 ]; then
- ocf_log warn \
- "killing process $pid ($user $command $mp)"
- elif [ $try -eq 3 ]; then
- ocf_log crit \
- "Could not clean up mount point $mp"
- ret=$FAIL
- fi
-
- if [ $try -gt 1 ]; then
- kill -9 $pid
- else
- kill -TERM $pid
- fi
- done < <(fuser -vm $mp | \
- grep -v PID | \
- sed 's;^'$mp';;' | \
- awk '{print $4,$2,$1}' | \
- sort -u -k 1,3)
- fi
- done
-
- return $ret
-}
-
-
-#
# Decide which quota options are enabled and return a string
# which we can pass to quotaon
#
@@ -950,7 +851,7 @@ startFilesystem: Creating mount point $mp for device $dev"
;;
$NO) # not mounted, continue
;;
- $FAIL)
+ *)
return $FAIL
;;
esac
@@ -1184,8 +1085,9 @@ stop: Could not match $OCF_RESKEY_device with a real device"
umount_failed=yes
if [ "$force_umount" ]; then
- killMountProcesses $mp
if [ $try -eq 1 ]; then
+ fuser -TERM -kvm "$mp"
+
if [ "$OCF_RESKEY_nfslock" = "yes" ] || \
[ "$OCF_RESKEY_nfslock" = "1" ]; then
ocf_log warning \
@@ -1197,15 +1099,11 @@ stop: Could not match $OCF_RESKEY_device with a real device"
notify_list_store $mp/.clumanager/statd
nfslock_reclaim=1
fi
+ else
+ fuser -kvm "$mp"
fi
fi
- if [ $try -ge $max_tries ]; then
- done=$YES
- else
- sleep $sleep_time
- let try=try+1
- fi
;;
*)
return $FAIL
@@ -1214,7 +1112,7 @@ stop: Could not match $OCF_RESKEY_device with a real device"
if [ $try -ge $max_tries ]; then
done=$YES
- elif [ "$done" -ne "$YES" ]; then
+ elif [ "$done" != "$YES" ]; then
sleep $sleep_time
let try=try+1
fi
diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
index c683ee6..108d6f3 100755
--- a/rgmanager/src/resources/netfs.sh
+++ b/rgmanager/src/resources/netfs.sh
@@ -349,113 +349,6 @@ isMounted () {
}
#
-# killMountProcesses mount_point
-#
-# Using lsof or fuser try to unmount the mount by killing of the processes
-# that might be keeping it busy.
-#
-killMountProcesses()
-{
- typeset -i ret=$SUCCESS
- typeset have_lsof=""
- typeset have_fuser=""
- typeset try
-
- if [ $# -ne 1 ]; then
- ocf_log err \
- "Usage: killMountProcesses mount_point"
- return $FAIL
- fi
-
- typeset mp=$1
-
- ocf_log notice "Forcefully unmounting $mp"
-
- #
- # Not all distributions have lsof. If not use fuser. If it
- # does, try both.
- #
- file=$(which lsof 2>/dev/null)
- if [ -f "$file" ]; then
- have_lsof=$YES
- fi
-
- file=$(which fuser 2>/dev/null)
- if [ -f "$file" ]; then
- have_fuser=$YES
- fi
-
- if [ -z "$have_lsof" -a -z "$have_fuser" ]; then
- ocf_log warn \
- "Cannot forcefully unmount $mp; cannot find lsof or fuser commands"
- return $FAIL
- fi
-
- for try in 1 2 3; do
- if [ -n "$have_lsof" ]; then
- #
- # Use lsof to free up mount point
- #
- while read command pid user
- do
- if [ -z "$pid" ]; then
- continue
- fi
-
- if [ $try -eq 1 ]; then
- ocf_log warn \
- "killing process $pid ($user $command $mp)"
- elif [ $try -eq 3 ]; then
- ocf_log crit \
- "Could not clean up mountpoint $mp"
- ret=$FAIL
- fi
-
- if [ $try -gt 1 ]; then
- kill -9 $pid
- else
- kill -TERM $pid
- fi
- done < <(lsof -w -bn 2>/dev/null | \
- grep -w -E "$mp(/.*|)\$" | \
- awk '{print $1,$2,$3}' | \
- sort -u -k 1,3)
- elif [ -n "$have_fuser" ]; then
- #
- # Use fuser to free up mount point
- #
- while read command pid user
- do
- if [ -z "$pid" ]; then
- continue
- fi
-
- if [ $try -eq 1 ]; then
- ocf_log warn \
- "killing process $pid ($user $command $mp)"
- elif [ $try -eq 3 ]; then
- ocf_log crit \
- "Could not clean up mount point $mp"
- ret=$FAIL
- fi
-
- if [ $try -gt 1 ]; then
- kill -9 $pid
- else
- kill -TERM $pid
- fi
- done < <(fuser -vm $mp | \
- grep -v PID | \
- sed 's;^'$mp';;' | \
- awk '{print $4,$2,$1}' | \
- sort -u -k 1,3)
- fi
- done
-
- return $ret
-}
-
-#
# startNFSFilesystem
#
startNFSFilesystem() {
@@ -637,15 +530,20 @@ stopNFSFilesystem() {
umount_failed=yes
- if [ "$force_umount" ]; then
- killMountProcesses $mp
- fi
+ if [ "$force_umount" ]; then
+ if [ $try -eq 1 ]; then
+ fuser -TERM -kvm "$mp"
+ else
+ fuser -kvm "$mp"
+ fi
+ fi
- if [ $try -ge $max_tries ]; then
- done=$YES
- else
- sleep $sleep_time
- let try=try+1
+
+ if [ $try -ge $max_tries ]; then
+ done=$YES
+ else
+ sleep $sleep_time
+ let try=try+1
fi
;;
*)
13 years, 10 months
cluster: RHEL48 - Revert "rgmanager: Kill correct PIDs during force_unmount"
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 458ed7e8c9801db88aa741ab6473ef7512612f90
Parent: 1ebe0d71a2cc822e3c805da33b815af3e3393ef0
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Mon Jun 14 16:18:32 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Mon Jun 14 16:18:32 2010 -0400
Revert "rgmanager: Kill correct PIDs during force_unmount"
This reverts commit 04d4b4acc681f8af1a467ffac077e5898ad19592.
---
rgmanager/src/resources/fs.sh | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index 46a5189..5b3a3bc 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -690,7 +690,6 @@ killMountProcesses()
typeset have_lsof=""
typeset have_fuser=""
typeset try
- typeset command pid user line
if [ $# -ne 1 ]; then
ocf_log err \
@@ -727,30 +726,30 @@ killMountProcesses()
#
# Use lsof to free up mount point
#
- while read line
+ while read command pid user
do
- path=$(echo $line | awk '{for (i=9;i<NF+1;i++) {printf "%s ",$i};}')
- #if [ -z $(echo $path | grep -E "$mp(/| |$)") ]
- if [ -z $(echo $path | grep -E "^$mp/.*") ]; then
+ if [ -z "$pid" ]; then
continue
fi
- command=$(echo $line | awk '{print $1}')
- pid=$(echo $line | awk '{print $2}')
- user=$(echo $line | awk '{print $3}')
+
if [ $try -eq 1 ]; then
- ocf_log warn "killing process $pid ($user $command $mp)"
+ ocf_log warn \
+ "killing process $pid ($user $command $mp)"
elif [ $try -eq 3 ]; then
- ocf_log crit "Could not clean up mountpoint $mp"
- ret=$FAIL
+ ocf_log crit \
+ "Could not clean up mountpoint $mp"
+ ret=$FAIL
fi
+
if [ $try -gt 1 ]; then
kill -9 $pid
else
kill -TERM $pid
fi
- done< <(lsof -bn 2>/dev/null | \
- grep -E " $mp(/| |$)" | \
- sort -u -k 1,3)
+ done < <(lsof -bn 2>/dev/null | \
+ grep -E "$mp(/.*|)\$" | \
+ awk '{print $1,$2,$3}' | \
+ sort -u -k 1,3)
elif [ -n "$have_fuser" ]; then
#
# Use fuser to free up mount point
13 years, 10 months
cluster: the annotated tag cluster-3.0.13 has been created
by Fabio M. Di Nitto
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 63fcb1eba1abdb7cdd94182b977b82240ffd9864
Parent: 0000000000000000000000000000000000000000
Author: Fabio M. Di Nitto <fdinitto(a)redhat.com>
AuthorDate: 2010-06-08 03:55 +0000
Committer: Fabio M. Di Nitto <fdinitto(a)redhat.com>
CommitterDate: 2010-06-08 03:55 +0000
annotated tag: cluster-3.0.13 has been created
at 63fcb1eba1abdb7cdd94182b977b82240ffd9864 (tag)
tagging 58dae2d17bbe8bebb36dfbfc3e75c76ce09a118d (commit)
replaces cluster-3.0.12
cluster-3.0.13 release
Bob Peterson (1):
Fix device name and mount point in utils
Christine Caulfield (2):
config: Fix ccs_tool create -n
cman: fix quorum recalculation when a node is externally killed
David Teigland (2):
dlm_controld: wrong fencing time comparison
dlm_controld: wrong fencing time comparison (2)
Fabio M. Di Nitto (2):
cman init: wait for corosync daemon to exit on stop
add missing man pages
Jonathan Brassow (1):
halvm: Fix bug 506587: lvm agent incorrectly reports vg is in volume_list
Lon Hohberger (1):
resource-agents: Resolve incorrect default
Marek 'marx' Grac (1):
fence_wti: Add direct support for WTI VMR
13 years, 11 months
cluster: RHEL56 - gfs2 manual pages: gfs2_convert manpage and documentation updates
by Abhijith Das
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 49d3da55baca52545da914d5682a64f8ffa44ed1
Parent: fabddd788110b7812b4d4d856db02644ef36756f
Author: Abhijith Das <adas(a)redhat.com>
AuthorDate: Mon Jun 7 11:28:58 2010 -0500
Committer: Abhijith Das <adas(a)redhat.com>
CommitterDate: Mon Jun 7 11:28:58 2010 -0500
gfs2 manual pages: gfs2_convert manpage and documentation updates
The recent fixes/updates to gfs2_convert changes its behavior
in a few cases such as handling of CDPNs, converting full
filesystems etc. This updates the manpage to reflect that.
Resolves: rhbz#588374
Signed-off-by: Abhi Das <adas(a)redhat.com>
---
gfs2/man/gfs2_convert.8 | 24 +++++++++++++++++++++++-
1 files changed, 23 insertions(+), 1 deletions(-)
diff --git a/gfs2/man/gfs2_convert.8 b/gfs2/man/gfs2_convert.8
index 2f6f2de..1f7d044 100644
--- a/gfs2/man/gfs2_convert.8
+++ b/gfs2/man/gfs2_convert.8
@@ -11,7 +11,13 @@ gfs2_convert - Convert a GFS1 filesystem to GFS2
[\fIOPTION\fR]... \fIDEVICE\fR
.SH DESCRIPTION
-gfs2_convert is used to convert a filesystem from GFS1 to GFS2.
+gfs2_convert is used to convert a filesystem from GFS1 to GFS2. It is
+required that the GFS1 filesystem be checked and fixed for errors using
+\fBgfs_fsck\fP and that the filesystem be backed up before
+attempting to convert it. The convert process is irreversible and any
+error encountered during the conversion can result in the abrupt
+termination of the program and consequently an unusable filesystem.
+See \fBNOTES\fP section below for more information.
.SH OPTIONS
.TP
@@ -47,3 +53,19 @@ changes.
gfs2_convert /dev/vg0/lvol0
This will convert the Global File System on the block device
"/dev/vg0/lvol0" to gfs2 format.
+
+.SH NOTES
+If gfs2_convert is interrupted for some reason other than a conversion
+failure, DO NOT run \fBgfs2_fsck\fP on this partially converted filesystem.
+When this occurs, reissue the gfs2_convert command on the partially converted
+filesystem to complete the conversion process.
+
+The GFS2 filesystem does not support Context-Dependent Path Names (CDPNs).
+gfs2_convert identifies such CDPNs and replaces them with empty directories
+with the same name. The administrator can use bind mounts on these
+directories to get the same effect as CDPNs.
+
+When converting full or nearly full filesystems, it is possible that there
+won't be enough space available to fit all the GFS2 filesystem data
+structures. In such cases, the size of all the journals is reduced uniformly
+such that everything fits in the available space.
13 years, 11 months
cluster: RHEL56 - gfs2-utils, gfs-kernel: Better error reporting when mounting a gfs fs without enough journals
by Abhijith Das
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: fabddd788110b7812b4d4d856db02644ef36756f
Parent: 805e0bae5db683fb33ec2e3c14b12c6380885494
Author: Abhijith Das <adas(a)redhat.com>
AuthorDate: Fri Jun 4 11:23:23 2010 -0500
Committer: Abhijith Das <adas(a)redhat.com>
CommitterDate: Fri Jun 4 11:23:23 2010 -0500
gfs2-utils, gfs-kernel: Better error reporting when mounting a gfs fs without enough journals
use EUSERS to signal to mount helper about insufficient journals so it doesn't
display a cryptic message
Resolves: rhbz#537201
Signed-off-by: Abhi Das <adas(a)redhat.com>
---
gfs-kernel/src/gfs/ops_fstype.c | 2 +-
gfs2/mount/mount.gfs2.c | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/gfs-kernel/src/gfs/ops_fstype.c b/gfs-kernel/src/gfs/ops_fstype.c
index a9d7733..1f5e8a5 100644
--- a/gfs-kernel/src/gfs/ops_fstype.c
+++ b/gfs-kernel/src/gfs/ops_fstype.c
@@ -447,7 +447,7 @@ static int init_journal(struct gfs_sbd *sdp, int undo)
else {
/* Discover this node's journal number (lock module tells us
which one to use), and lock it */
- error = -EINVAL;
+ error = -EUSERS;
if (sdp->sd_lockstruct.ls_jid >= sdp->sd_journals) {
printk("GFS: fsid=%s: can't mount journal #%u\n",
sdp->sd_fsname, sdp->sd_lockstruct.ls_jid);
diff --git a/gfs2/mount/mount.gfs2.c b/gfs2/mount/mount.gfs2.c
index d8a60c3..1ef6ccd 100644
--- a/gfs2/mount/mount.gfs2.c
+++ b/gfs2/mount/mount.gfs2.c
@@ -243,6 +243,8 @@ int main(int argc, char **argv)
if (errno == EBUSY)
die("%s already mounted or %s busy\n", mo.dev, mo.dir);
+ else if (errno == EUSERS)
+ die("Too many nodes mounting filesystem, no free journals\n");
die("error mounting %s on %s: %s\n", mo.dev, mo.dir,
strerror(errno));
}
13 years, 11 months
cluster: RHEL55 - resource-agents: Add status_program attribute
by Lon Hohberger
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: e44f2175836fbc9ec95b761781911ca2a6cc570a
Parent: d97be02b2f557e7e60a2f804353ae639868ef67d
Author: Lon Hohberger <lhh(a)redhat.com>
AuthorDate: Tue May 4 17:54:15 2010 -0400
Committer: Lon Hohberger <lhh(a)redhat.com>
CommitterDate: Thu Jun 3 14:03:30 2010 -0400
resource-agents: Add status_program attribute
Fix previous patch which contained an incorrect default.
Resolves: bz594476
Signed-off-by: Lon Hohberger <lhh(a)redhat.com>
---
rgmanager/src/resources/vm.sh | 33 ++++++++++++++++++++++++++++++++-
1 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/rgmanager/src/resources/vm.sh b/rgmanager/src/resources/vm.sh
index d2932dd..c8be516 100755
--- a/rgmanager/src/resources/vm.sh
+++ b/rgmanager/src/resources/vm.sh
@@ -213,6 +213,20 @@ meta_data()
<content type="string" default="0"/>
</parameter>
+ <parameter name="status_program" reconfig="1">
+ <longdesc lang="en">
+ Ordinarily, only the presence/health of a virtual machine
+ is checked. If specified, the status_program value is
+ executed during a depth 10 check. The intent of this
+ program is to ascertain the status of critical services
+ within a virtual machine.
+ </longdesc>
+ <shortdesc lang="en">
+ Additional status check program
+ </shortdesc>
+ <content type="string" default=""/>
+ </parameter>
+
<parameter name="hypervisor">
<shortdesc lang="en">
Hypervisor
@@ -255,6 +269,10 @@ meta_data()
<action name="status" timeout="10" interval="30"/>
<action name="monitor" timeout="10" interval="30"/>
+ <!-- depth 10 calls the status_program -->
+ <action name="status" depth="10" timeout="10" interval="300"/>
+ <action name="monitor" depth="10" timeout="10" interval="300"/>
+
<!-- reconfigure - reconfigure with new OCF parameters.
NOT OCF COMPATIBLE AT ALL -->
<action name="reconfig" timeout="10"/>
@@ -543,7 +561,11 @@ virsh_status()
return 0
fi
- return 1
+ if [ "$state" = "shut off" ]; then
+ return $OCF_NOT_RUNNING
+ fi
+
+ return $OCF_ERR_GENERIC
}
@@ -923,6 +945,15 @@ case $1 in
validate_all || exit $OCF_ERR_ARGS
echo -n "Virtual machine $OCF_RESKEY_name is "
do_status
+ rv=$?
+ if [ $rv -ne 0 ]; then
+ exit $rv
+ fi
+ [ -z "$OCF_RESKEY_status_program" ] && exit 0
+ [ -z "$OCF_CHECK_LEVEL" ] && exit 0
+ [ $OCF_CHECK_LEVEL -lt 10 ] && exit 0
+
+ bash -c "$OCF_RESKEY_status_program" &> /dev/null
exit $?
;;
migrate)
13 years, 11 months