Last change
on this file since 33 was
16,
checked in by rock, 16 years ago
|
|
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Rev | Line | |
---|
[16] | 1 | #!/bin/ksh |
---|
| 2 | # @(#)76 1.4.1.3 src/avs/fs/mmfs/samples/nfscluster/cleanup, mmfs, avs_rgpfs24, rgpfs24s005a 6/26/06 15:16:12 |
---|
| 3 | # |
---|
| 4 | # cleanup |
---|
| 5 | # |
---|
| 6 | ############################################################################## |
---|
| 7 | if [ ! -f /var/mmfs/etc/nfsfuncs ]; then |
---|
| 8 | echo "$0: Can't find NFS functions in /var/mmfs/etc" |
---|
| 9 | exit 0 |
---|
| 10 | fi |
---|
| 11 | . /var/mmfs/etc/nfsfuncs |
---|
| 12 | |
---|
| 13 | # Check for locks |
---|
| 14 | locks=$( cat /proc/locks | grep "POSIX" ) |
---|
| 15 | if [ "$locks" != "" ]; then |
---|
| 16 | secs=45 |
---|
| 17 | else |
---|
| 18 | secs=3 |
---|
| 19 | fi |
---|
| 20 | if [[ "$REBOOT" == "1" && -f /tmp/ha-nfs-reboot ]]; then |
---|
| 21 | echo "$0: rebooting this node in $secs seconds" |
---|
| 22 | sleep $secs |
---|
| 23 | /usr/lpp/mmfs/bin/mmfsadm cleanup |
---|
| 24 | debuglog rm /tmp/ha-nfs-reboot |
---|
| 25 | reboot |
---|
| 26 | exit |
---|
| 27 | fi |
---|
| 28 | |
---|
| 29 | msg "$0 waiting $secs seconds before starting NLM cleanup" |
---|
| 30 | sleep $secs |
---|
| 31 | msg "$0 starting NLM cleanup" |
---|
| 32 | |
---|
| 33 | # Terminate all NFS service. |
---|
| 34 | nfsService terminate |
---|
| 35 | |
---|
| 36 | FSTYPE=gpfs |
---|
| 37 | UMOUNTALL="/bin/umount -a" |
---|
| 38 | # Note: Do not redirect stderr on Linux umount. |
---|
| 39 | STDERR_REDIRECT="" |
---|
| 40 | |
---|
| 41 | # Busy file systems will not unmount. |
---|
| 42 | $(eval $UMOUNTALL -t $FSTYPE $STDERR_REDIRECT) |
---|
| 43 | |
---|
| 44 | # Try forced unmount. |
---|
| 45 | $UMOUNTALL -f -t $FSTYPE |
---|
| 46 | |
---|
| 47 | # Do any commands here to clean up local state |
---|
| 48 | # before the GPFS daemon restarts. |
---|
| 49 | |
---|
| 50 | # Clean GPFS |
---|
| 51 | /usr/lpp/mmfs/bin/mmfsadm cleanup |
---|
| 52 | /usr/lpp/mmfs/bin/mmfsenv -u |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | return 0 |
---|
| 56 | |
---|
Note: See
TracBrowser
for help on using the repository browser.