source: gpfs_3.1_ker2.6.20/lpp/mmfs/samples/nfscluster/cleanup @ 145

Last change on this file since 145 was 16, checked in by rock, 17 years ago
  • Property svn:executable set to *
File size: 1.2 KB
Line 
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##############################################################################
7if [ ! -f /var/mmfs/etc/nfsfuncs ]; then
8    echo "$0: Can't find NFS functions in /var/mmfs/etc"
9    exit 0
10fi
11. /var/mmfs/etc/nfsfuncs
12
13# Check for locks
14locks=$( cat /proc/locks | grep "POSIX" )
15if [ "$locks" != "" ]; then
16  secs=45
17else
18  secs=3
19fi
20if [[ "$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
27fi
28
29msg "$0 waiting $secs seconds before starting NLM cleanup"
30sleep $secs
31msg "$0 starting NLM cleanup"
32
33# Terminate all NFS service.
34nfsService terminate
35
36FSTYPE=gpfs
37UMOUNTALL="/bin/umount -a"
38# Note: Do not redirect stderr on Linux umount.
39STDERR_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
55return 0
56
Note: See TracBrowser for help on using the repository browser.