Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
pvfs2-osd/examples/heartbeat/pvfs2-stonith-plugin
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
91 lines (90 sloc)
1.67 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# External STONITH module for power control of PVFS2 servers | |
case $1 in | |
gethosts) | |
/usr/bin/fs-power-gethosts.pl --fs-name $fs_name | |
exit 0 | |
;; | |
on) | |
/usr/bin/fs-power-control.pl --fs-name $fs_name --conf-dir $fs_conf_dir --host $2 --command on | |
RETVAL=$? | |
if [ $RETVAL -ne 0 ]; then | |
exit 1 | |
fi | |
exit 0 | |
;; | |
off) | |
/usr/bin/fs-power-control.pl --fs-name $fs_name --conf-dir $fs_conf_dir --host $2 --command off | |
RETVAL=$? | |
if [ $RETVAL -ne 0 ]; then | |
exit 1 | |
fi | |
exit 0 | |
;; | |
reset) | |
/usr/bin/fs-power-control.pl --fs-name $fs_name --conf-dir $fs_conf_dir --host $2 --command reboot | |
RETVAL=$? | |
if [ $RETVAL -ne 0 ]; then | |
exit 1 | |
fi | |
exit 0 | |
;; | |
status) | |
/usr/bin/fs-power-monitor.pl --conf-dir $fs_conf_dir --fs-name $fs_name | |
RETVAL=$? | |
if [ $RETVAL -ne 0 ]; then | |
exit 1 | |
fi | |
exit 0 | |
;; | |
getconfignames) | |
echo "fs_name" | |
echo "fs_conf_dir" | |
exit 0 | |
;; | |
getinfo-devid) | |
echo "PVFS2 stonith device" | |
exit 0 | |
;; | |
getinfo-devname) | |
echo "PVFS2 stonith device" | |
exit 0 | |
;; | |
getinfo-devdescr) | |
echo "Power control for PVFS2 servers" | |
exit 0 | |
;; | |
getinfo-devurl) | |
echo "NONE" | |
exit 0 | |
;; | |
getinfo-xml) | |
cat << XML | |
<parameters> | |
<parameter name="fs_name" unique="1" required="1"> | |
<content type="string" /> | |
<shortdesc lang="en"> | |
file system name | |
</shortdesc> | |
<longdesc lang="en"> | |
Name of the file system that this device is being used with | |
</longdesc> | |
</parameter> | |
<parameter name="fs_conf_dir" unique="1" required="1"> | |
<content type="string" /> | |
<shortdesc lang="en"> | |
file system configuration directory | |
</shortdesc> | |
<longdesc lang="en"> | |
Path to the shared configuration directory for the file system | |
</longdesc> | |
</parameter> | |
</parameters> | |
XML | |
exit 0 | |
;; | |
*) | |
exit 1 | |
;; | |
esac |