home *** CD-ROM | disk | FTP | other *** search
/ ftp.parl.clemson.edu / 2015-02-07.ftp.parl.clemson.edu.tar / ftp.parl.clemson.edu / pub / pvfs2 / orangefs-2.8.3-20110323.tar.gz / orangefs-2.8.3-20110323.tar / orangefs / examples / heartbeat / hardware-specific / pvfs2-stonith-plugin < prev    next >
Text File  |  2008-04-24  |  2KB  |  92 lines

  1. #!/bin/sh
  2. #
  3. # External STONITH module for power control of PVFS2 servers
  4.  
  5. case $1 in
  6. gethosts)
  7.     /usr/bin/fs-power-gethosts.pl --fs-name $fs_name
  8.     exit 0
  9.     ;;
  10. on)
  11.     /usr/bin/fs-power-control.pl --fs-name $fs_name --conf-dir $fs_conf_dir --host $2 --command on
  12.     RETVAL=$?
  13.         if [ $RETVAL -ne 0 ]; then
  14.       exit 1
  15.     fi
  16.     exit 0
  17.     ;;
  18. off)
  19.     /usr/bin/fs-power-control.pl --fs-name $fs_name --conf-dir $fs_conf_dir --host $2 --command off
  20.     RETVAL=$?
  21.         if [ $RETVAL -ne 0 ]; then
  22.       exit 1
  23.     fi
  24.     exit 0
  25.     ;;
  26. reset)
  27.     /usr/bin/fs-power-control.pl --fs-name $fs_name --conf-dir $fs_conf_dir --host $2 --command reboot
  28.     RETVAL=$?
  29.         if [ $RETVAL -ne 0 ]; then
  30.       exit 1
  31.     fi
  32.     exit 0
  33.     ;;
  34. status)
  35.     /usr/bin/fs-power-monitor.pl --conf-dir $fs_conf_dir --fs-name $fs_name
  36.     RETVAL=$?
  37.         if [ $RETVAL -ne 0 ]; then
  38.       exit 1
  39.     fi
  40.     exit 0
  41.     ;;
  42. getconfignames)
  43.     echo "fs_name"
  44.     echo "fs_conf_dir"
  45.     exit 0
  46.     ;;
  47. getinfo-devid)
  48.     echo "PVFS2 stonith device"
  49.     exit 0
  50.     ;;
  51. getinfo-devname)
  52.     echo "PVFS2 stonith device"
  53.     exit 0
  54.     ;;
  55. getinfo-devdescr)
  56.     echo "Power control for PVFS2 servers"
  57.     exit 0
  58.     ;;
  59. getinfo-devurl)
  60.     echo "NONE"
  61.     exit 0
  62.     ;;
  63. getinfo-xml)
  64.     cat << XML
  65. <parameters>
  66. <parameter name="fs_name" unique="1" required="1">
  67. <content type="string" />
  68. <shortdesc lang="en">
  69. file system name
  70. </shortdesc>
  71. <longdesc lang="en">
  72. Name of the file system that this device is being used with
  73. </longdesc>
  74. </parameter>
  75. <parameter name="fs_conf_dir" unique="1" required="1">
  76. <content type="string" />
  77. <shortdesc lang="en">
  78. file system configuration directory
  79. </shortdesc>
  80. <longdesc lang="en">
  81. Path to the shared configuration directory for the file system
  82. </longdesc>
  83. </parameter>
  84. </parameters>
  85. XML
  86.     exit 0
  87.     ;;
  88. *)
  89.     exit 1
  90.     ;;
  91. esac
  92.