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 26 74
13 # description: Mounts and unmounts all Lustre mount points.
17 # Required-Start: $network
18 # Required-Stop: $network
21 # Default-Start: 3 4 5
22 # Default-Stop: 0 1 2 6
23 # Short-Description: Mounts and unmounts all Lustre mount points.
25 ## Provides: $local_fs $remote_fs
27 # Source function library.
28 if [ -f /etc/init.d/functions ]; then
29 . /etc/init.d/functions
32 # Source networking configuration.
33 if [ -f /etc/sysconfig/network ]; then
34 . /etc/sysconfig/network
37 # Source lsb-functions.
38 if [ -f /lib/lsb/init-functions ]; then
39 . /lib/lsb/init-functions
42 # Check that networking is up.
43 [ "${NETWORKING}" = "no" ] && exit 0
45 # Red Hat has it's own "action"-function for RHGB-messages.
49 if [ $(typeset -F action) ]; then
56 log_success_msg "$STRING"
58 log_failure_msg "$STRING"
64 LUSTREFSTAB=`LC_ALL=C awk '!/^#/ && $3 == "lustre" && $4 !~ /noauto/ { print $2 }' /etc/fstab`
65 LUSTREMTAB=`LC_ALL=C awk '!/^#/ && $3 == "lustre" { print $2 }' /proc/mounts`
67 # See how we were called.
70 [ -n "$LUSTREFSTAB" ] && lustre_action $"Mounting Lustre filesystems: " mount -a -t lustre
71 touch /var/lock/subsys/lustrefs
74 [ -n "$LUSTREMTAB" ] && {
77 remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^lustre/ && $2 != "/" {print $2}' /proc/mounts`
78 while [ -n "$remaining" -a "$retry" -gt 0 ]
80 if [ "$retry" -lt 3 ]; then
81 lustre_action $"Unmounting Lustre filesystems (retry): " umount -f -a -t lustre
83 lustre_action $"Unmounting Lustre filesystems: " umount -a -t lustre
86 remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^lustre/ && $2 != "/" {print $2}' /proc/mounts`
87 [ -z "$remaining" ] && break
88 /sbin/fuser -k -m $sig $remaining >/dev/null
94 rm -f /var/lock/subsys/lustrefs
97 if [ -f /proc/mounts ] ; then
98 [ -n "$LUSTREFSTAB" ] && {
99 echo $"Configured Lustre mountpoints: "
100 for fs in $LUSTREFSTAB; do echo $fs ; done
102 [ -n "$LUSTREMTAB" ] && {
103 echo $"Active Lustre mountpoints: "
104 for fs in $LUSTREMTAB; do echo $fs ; done
107 echo $"/proc filesystem unavailable"
118 echo $"Usage: $0 {start|stop|restart|reload|status}"