Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F1841305
sbd.agent
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
sbd.agent
View Options
#!/bin/bash
#
# This STONITH script drives the shared-storage stonith plugin.
#
# Author: Lars Marowsky-Bree
# Copyright: 2008 Lars Marowsky-Bree
# License: GNU General Public License (GPL)
#
# Main code
case $1 in
gethosts)
echo `sbd -d $sbd_device list | cut -f2`
exit 0
;;
off|reset)
sbd -d $sbd_device message $2 $1
exit $?
;;
status)
if ! sbd -d $sbd_device list >/dev/null 2>&1 ; then
ha_log err "sbd could not list nodes from $sbd_device"
exit 1
fi
nodes="$(crm_node -l)"
if [ -z "$node" ]; then
# No active nodes; strange, but maybe not running pacemaker?
ha_log warn "no active nodes reported by the CRM"
exit 0
fi
for N in $nodes ; do
if ! sbd -d $sbd_device ping $N >/dev/null 2>&1 ; then
ha_log err "node $N not accessible through $sbd_device"
exit 1
fi
done
exit 0
;;
on)
exit 1
;;
getconfignames)
echo "sbd_device"
exit 0
;;
getinfo-devid)
echo "Shared storage STONITH device"
exit 0
;;
getinfo-devname)
echo "Shared storage STONITH device"
exit 0
;;
getinfo-devdescr)
cat << DESC
sbd uses a shared storage device as a medium to communicate
fencing requests. This allows clusters without network power
switches; the downside is that access to the shared storage
device becomes a Single Point of Failure.
It requires sbd to be configured. Please read
http://linux-ha.org/wiki/SBD_Fencing!
DESC
exit 0
;;
getinfo-devurl)
echo "http://linux-ha.org/wiki/SBD_Fencing"
exit 0
;;
getinfo-xml)
cat << SSHXML
<parameters>
<parameter name="sbd_device" unique="1" required="1">
<content type="string" />
<shortdesc lang="en">
SBD device
</shortdesc>
<longdesc lang="en">
The block device used for the SBD partition.
</longdesc>
</parameter>
</parameters>
SSHXML
exit 0
;;
*)
exit 1
;;
esac
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Sat, Nov 23, 3:04 AM (27 m, 42 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1018083
Default Alt Text
sbd.agent (1 KB)
Attached To
Mode
rS SBD
Attached
Detach File
Event Timeline
Log In to Comment