3 # lustrefs Mount Lustre filesystems.
5 # Authors: Jacob Berkman <jacob@clusterfs.com>
7 # Based on the netfs script:
9 # Authors: Bill Nottingham <notting@redhat.com>
10 # Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
12 # chkconfig: 345 25 75
13 # description: Mounts and unmounts all Lustre mount points.
16 # Provides: $local_fs $remote_fs
19 [ -f /etc/sysconfig/network ] || exit 0
20 . /etc/init.d/functions
21 . /etc/sysconfig/network
23 # Check that networking is up.
24 [ "${NETWORKING}" = "no" ] && exit 0
26 LUSTREFSTAB=`LC_ALL=C awk '!/^#/ && $3 == "lustre" && $4 !~ /noauto/ { print $2 }' /etc/fstab`
27 LUSTREMTAB=`LC_ALL=C awk '!/^#/ && $3 == "lustre" { print $2 }' /proc/mounts`
29 # See how we were called.
32 [ -n "$LUSTREFSTAB" ] && action $"Mounting Lustre filesystems: " mount -a -t lustre
33 touch /var/lock/subsys/lustrefs
36 [ -n "$LUSTREMTAB" ] && {
39 remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^lustre/ && $2 != "/" {print $2}' /proc/mounts`
40 while [ -n "$remaining" -a "$retry" -gt 0 ]
42 if [ "$retry" -lt 3 ]; then
43 action $"Unmounting Lustre filesystems (retry): " umount -f -a -t lustre
45 action $"Unmounting Lustre filesystems: " umount -a -t lustre
48 remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^lustre/ && $2 != "/" {print $2}' /proc/mounts`
49 [ -z "$remaining" ] && break
50 /sbin/fuser -k -m $sig $remaining >/dev/null
56 rm -f /var/lock/subsys/lustrefs
59 if [ -f /proc/mounts ] ; then
60 [ -n "$LUSTREFSTAB" ] && {
61 echo $"Configured Lustre mountpoints: "
62 for fs in $LUSTREFSTAB; do echo $fs ; done
64 [ -n "$LUSTREMTAB" ] && {
65 echo $"Active Lustre mountpoints: "
66 for fs in $LUSTREMTAB; do echo $fs ; done
69 echo $"/proc filesystem unavailable"
80 echo $"Usage: $0 {start|stop|restart|reload|status}"