Send Linux-ha-cvs mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
[EMAIL PROTECTED]
You can reach the person managing the list at
[EMAIL PROTECTED]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."
Today's Topics:
1. Linux-HA CVS: resources by xunsun from
([email protected])
2. Linux-HA CVS: resources by xunsun from
([email protected])
3. Linux-HA CVS: resources by xunsun from
([email protected])
4. Linux-HA CVS: resources by xunsun from
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Sat, 11 Feb 2006 06:40:43 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by xunsun from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : xunsun
Host :
Project : linux-ha
Module : resources
Dir : linux-ha/resources/heartbeat
Modified Files:
Filesystem.in
Log Message:
add the ability to deal with sub-mounts (Toby <[EMAIL PROTECTED]>), and fix a
typo in heartbeat Filesystem RA
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/heartbeat/Filesystem.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- Filesystem.in 3 Nov 2005 07:45:51 -0000 1.5
+++ Filesystem.in 11 Feb 2006 13:40:42 -0000 1.6
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: Filesystem.in,v 1.5 2005/11/03 07:45:51 xunsun Exp $
+# $Id: Filesystem.in,v 1.6 2006/02/11 13:40:42 xunsun Exp $
#
# Description: wrapper of OCF RA Filesystem, based on original heartbeat RA.
# See OCF RA Filesystem for more information.
@@ -48,13 +48,13 @@
<fstype> : optional name of the filesystem type. e.g. ext2
<options> : options to be given as -o options to mount.
- $Id: Filesystem.in,v 1.5 2005/11/03 07:45:51 xunsun Exp $
+ $Id: Filesystem.in,v 1.6 2006/02/11 13:40:42 xunsun Exp $
EOT
}
# Check the arguments passed to this script
case $# in
- 3) fstype=""; operation=$4; options="";;
+ 3) fstype=""; operation=$3; options="";;
4) fstype=$3; operation=$4; options="";;
5) fstype=$3; operation=$5; options="$4";;
*) usage; exit 1;;
------------------------------
Message: 2
Date: Sat, 11 Feb 2006 06:40:43 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by xunsun from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : xunsun
Host :
Project : linux-ha
Module : resources
Dir : linux-ha/resources/OCF
Modified Files:
Filesystem.in
Log Message:
add the ability to deal with sub-mounts (Toby <[EMAIL PROTECTED]>), and fix a
typo in heartbeat Filesystem RA
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/Filesystem.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- Filesystem.in 26 Jan 2006 18:00:05 -0000 1.14
+++ Filesystem.in 11 Feb 2006 13:40:42 -0000 1.15
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: Filesystem.in,v 1.14 2006/01/26 18:00:05 lars Exp $
+# $Id: Filesystem.in,v 1.15 2006/02/11 13:40:42 xunsun Exp $
#
# Support: [EMAIL PROTECTED]
# License: GNU General Public License (GPL)
@@ -95,7 +95,7 @@
usage() {
cat <<-EOT
usage: $0 {start|stop|status|monitor|validate-all|meta-data}
- $Id: Filesystem.in,v 1.14 2006/01/26 18:00:05 lars Exp $
+ $Id: Filesystem.in,v 1.15 2006/02/11 13:40:42 xunsun Exp $
EOT
}
@@ -188,7 +188,6 @@
Filesystem_start()
{
# See if the device is already mounted.
-#$MOUNT | cut -d' ' -f3 | grep -e "^$MOUNTPOINT$" >/dev/null
Filesystem_status >/dev/null 2>&1
if [ $? -eq $OCF_SUCCESS ] ; then
ocf_log info "Filesystem $MOUNTPOINT is already mounted."
@@ -273,21 +272,28 @@
{
# See if the device is currently mounted
if
- Filesystem_status >/dev/null 2>&1
+ Filesystem_status >/dev/null 2>&1
then
-# By sending both signals twice, we eliminate the need for `sleep` after them
+ # Umount all sub-filesystems mounted under $MOUNTPOINT/
+ # (e.g. /proc in chroots)
+ for SUB in `$MOUNT | grep "on $MOUNTPOINT/" | cut -d' ' -f3 | tac`
; do
+ $FUSER -m -k $SUB
+ $UMOUNT $SUB
+ done
+
+ # By sending both signals twice, we eliminate the need
+ # for `sleep` after them.
for sig in SIGTERM SIGTERM SIGKILL SIGKILL; do
if [ $blockdevice = "yes" ]; then
- $FUSER -$sig -mk $DEVICE
+ $FUSER -$sig -m -k $DEVICE
else
- $FUSER -$sig -mk $MOUNTPOINT
+ $FUSER -$sig -m -k $MOUNTPOINT
fi
-
-# fuser returns a non-zero return code if none of the specified files is
-# accessed or in case of a fatal error, in either case we stop sending signal.
-# If at least one access has been found, fuser returns zero, then we should
-# try it again.
-
+ # fuser returns a non-zero return code if none of the
+ # specified files is accessed or in case of a fatal
+ # error, in either case we stop sending signal. If at
+ # least one access has been found, fuser returns zero,
+ # then we should try it again.
if [ $? -ne 0 ]; then
break
fi
@@ -357,12 +363,6 @@
ocf_log warn "Mountpoint $MOUNTPOINT does not exist"
fi
-# See if the mountpoint is already occupied.
- $MOUNT | cut -d' ' -f3 | grep -e "^$MOUNTPOINT$" >/dev/null
- if [ $? -eq 0 ] ; then
- ocf_log info "Mountpoint $MOUNTPOINT is already used."
- fi
-
# Check if the $FSTYPE is workable
# NOTE: Without inserting the $FSTYPE module, this step may be imprecise
if [ ! -z $FSTYPE ]; then
------------------------------
Message: 3
Date: Sat, 11 Feb 2006 07:21:21 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by xunsun from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : xunsun
Host :
Project : linux-ha
Module : resources
Dir : linux-ha/resources/OCF
Modified Files:
Delay.in
Log Message:
cleanup
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/Delay.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- Delay.in 21 Dec 2005 05:36:52 -0000 1.8
+++ Delay.in 11 Feb 2006 14:21:20 -0000 1.9
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: Delay.in,v 1.8 2005/12/21 05:36:52 zhenh Exp $
+# $Id: Delay.in,v 1.9 2006/02/11 14:21:20 xunsun Exp $
#
# Support: [EMAIL PROTECTED]
# License: GNU General Public License (GPL)
@@ -36,7 +36,7 @@
usage() {
cat <<-!
usage: $0 {start|stop|status|monitor|meta-data|validate-all}
- $Id: Delay.in,v 1.8 2005/12/21 05:36:52 zhenh Exp $
+ $Id: Delay.in,v 1.9 2006/02/11 14:21:20 xunsun Exp $
!
}
@@ -104,8 +104,8 @@
ocf_log info "Delay is running OK"
return $OCF_SUCCESS
else
- ocf_log err "Delay is not operational"
- return $OCF_ERR_GENERIC
+ ocf_log info "Delay is stopped"
+ return $OCF_NOT_RUNNING
fi
}
------------------------------
Message: 4
Date: Sat, 11 Feb 2006 07:31:14 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by xunsun from
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>
linux-ha CVS committal
Author : xunsun
Host :
Project : linux-ha
Module : resources
Dir : linux-ha/resources/OCF
Modified Files:
WAS.in
Log Message:
cleanup
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/OCF/WAS.in,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- WAS.in 26 Jan 2006 18:00:05 -0000 1.8
+++ WAS.in 11 Feb 2006 14:31:14 -0000 1.9
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# $Id: WAS.in,v 1.8 2006/01/26 18:00:05 lars Exp $
+# $Id: WAS.in,v 1.9 2006/02/11 14:31:14 xunsun Exp $
#
# WAS
#
@@ -99,7 +99,7 @@
We run servlet/snoop on the first transport port listed in
the config file for the "monitor" operation.
- $Id: WAS.in,v 1.8 2006/01/26 18:00:05 lars Exp $
+ $Id: WAS.in,v 1.9 2006/02/11 14:31:14 xunsun Exp $
!
}
@@ -479,19 +479,10 @@
}
#
-# Check if the port is valid, this function code is not decent, but works
+# Check if the port is valid
#
CheckPort() {
-# Examples of valid port: "1080", "1", "0080"
-# Examples of invalid port: "1080bad", "0", "0000", ""
- case "$1" in
- *[^0-9]*) #got invalid char
- false;;
- *[1-9]*) #no invalid char, and has non-zero digit, so is a good port
- true;;
- *) #empty string, or string of 0's
- false;;
- esac
+ ocf_is_decimal "$1" && [ $1 -gt 0 ]
}
WAS_validate_all() {
------------------------------
_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
End of Linux-ha-cvs Digest, Vol 27, Issue 50
********************************************