~ampelbein/ubuntu/oneiric/heartbeat/lp-770743

« back to all changes in this revision

Viewing changes to heartbeat/lib/hb_standby

  • Committer: Bazaar Package Importer
  • Author(s): Ante Karamatic
  • Date: 2009-08-10 19:29:25 UTC
  • mfrom: (5.2.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090810192925-9zy2llcbgavbskf7
Tags: 2.99.2+sles11r9-5ubuntu1
* New upstream snapshot
* Adjusted heartbeat.install and rules for documentation path

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
#
4
 
# Support:      linux-ha-dev@lists.tummy.com
5
 
# License:      GNU General Public License (GPL)
6
 
#
7
 
# This script sets the node (where it was called) to *standby*
8
 
# It forces the node to release all the held resources and lets
9
 
# the other node do a takeover.
10
 
 
11
 
#       This script will only work for a two machine setup...
12
 
#       More than that and you need to vote, or something...
13
 
 
14
 
HA_DIR=/etc/ha.d
15
 
. ${HA_DIR}/shellfuncs
16
 
 
17
 
: Now running $0: $*
18
 
 
19
 
usage() {
20
 
        echo "usage:"
21
 
        echo "$0 [all|foreign|local|failback]" >&2
22
 
        exit 1;
23
 
}
24
 
 
25
 
if
26
 
  [ $# -ge 2 ]
27
 
then
28
 
        echo "$0: too many arguments"
29
 
        usage
30
 
        exit 1
31
 
fi
32
 
 
33
 
if
34
 
  [ $# -ge 1 ]
35
 
then
36
 
  resources=$1
37
 
else
38
 
  resources=all
39
 
fi
40
 
 
41
 
if [ $resources != "all" ] && [ $resources != "foreign" ] &&
42
 
   [ $resources != "local" ] && [ $resources != "failback" ] &&
43
 
   [ $resources != "--help" ]; then
44
 
        echo "$0: wrong resources($resources)."
45
 
        usage
46
 
        exit 1
47
 
fi
48
 
 
49
 
case $resources in
50
 
  all|foreign|local)    ;;
51
 
  failback)             resources=foreign;;
52
 
  *)                    usage;;
53
 
esac
54
 
    
55
 
ha_log "Going standby [$resources]."
56
 
        ha_clustermsg <<-!MSG
57
 
        t=ask_resources
58
 
        rsc_hold=$resources
59
 
        info=me
60
 
        !MSG