1 | #!/bin/ksh |
---|
2 | # @(#)59 1.5 src/avs/fs/mmfs/samples/nfscluster/gpfsrecovernode.scr, mmfs, avs_rgpfs24, rgpfs240610b 2/24/06 10:48:25 |
---|
3 | # |
---|
4 | # This shell script is called by the mmfsd daemon during node failure |
---|
5 | # recovery before any distributed locks held by failed nodes are released. |
---|
6 | # |
---|
7 | # IMPORTANT: This script is invoked synchronously, i.e., NAS recovery will |
---|
8 | # not progress until this script finishes. Therefore, it should not invoke |
---|
9 | # any long-running actions, and it MUST NOT attempt to access any files or |
---|
10 | # directories in a NAS file system. |
---|
11 | |
---|
12 | # The script is invoked with the following parameters: |
---|
13 | # - The first parameter is the "recovery phase". |
---|
14 | # - The second parameter is the IP address used by GPFS for this node. |
---|
15 | # - The remaining parameters are the IP addresses of all failed nodes |
---|
16 | # for which recovery is being run. |
---|
17 | # |
---|
18 | # Note: Should additional node failures occur while node failure recovery |
---|
19 | # is in progress, this script may be invoked more than once. |
---|
20 | |
---|
21 | if [ ! -f /var/mmfs/etc/nfsrecovernode.scr ]; then |
---|
22 | echo "$0: Can't find nfsrecovernode.scr in /var/mmfs/etc" |
---|
23 | exit 0 |
---|
24 | fi |
---|
25 | if [ ! -f /var/mmfs/etc/nfsfuncs ]; then |
---|
26 | echo "$0: Can't find NFS functions in /var/mmfs/etc" |
---|
27 | exit 0 |
---|
28 | fi |
---|
29 | . /var/mmfs/etc/nfsfuncs |
---|
30 | |
---|
31 | allparms=$* |
---|
32 | phase=$1 |
---|
33 | me=$2 |
---|
34 | shift 2 |
---|
35 | failed=$* |
---|
36 | |
---|
37 | debugmsg "phase=$phase; I am $me; failed nodes are $failed" |
---|
38 | |
---|
39 | # Start grace period before GPFS recovery can complete. |
---|
40 | if [ $phase -eq 1 ]; then |
---|
41 | startGrace |
---|
42 | msg "NLM grace period started due to failure of $failed" |
---|
43 | fi |
---|
44 | |
---|
45 | # Do the rest asynchronously allowing GPFS recovery to complete so we can use |
---|
46 | # the shared filesystem to keep state. |
---|
47 | nohup /var/mmfs/etc/nfsrecovernode.scr $allparms >> $LOGFILE 2>&1 & |
---|