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>
13 # description: Mounts and unmounts all Lustre mount points.
17 # Required-Start: $network $remote_fs +sshd +lustre
18 # Required-Stop: $network $remote_fs
22 # Default-Stop: 0 1 2 6
23 # Short-Description: Mounts and unmounts all Lustre mount points.
26 # Source function library.
27 if [ -f /etc/init.d/functions ]; then
28 . /etc/init.d/functions
31 # Source networking configuration.
32 if [ -f /etc/sysconfig/network ]; then
33 . /etc/sysconfig/network
36 # Source lsb-functions.
37 if [ -f /lib/lsb/init-functions ]; then
38 . /lib/lsb/init-functions
41 [ -x /sbin/fuser ] && FUSER=/sbin/fuser
42 [ -x /bin/fuser ] && FUSER=/bin/fuser
44 # Check that networking is up.
45 [ "${NETWORKING}" = "no" ] && exit 0
47 # Red Hat has it's own "action"-function for RHGB-messages.
51 if [ $(typeset -F action) ]; then
58 log_success_msg "$STRING"
60 log_failure_msg "$STRING"
66 LUSTREFSTAB=`LC_ALL=C awk '!/^#/ && $3 == "lustre" && $4 !~ /noauto/ { print $2 }' /etc/fstab`
67 LUSTREMTAB=`LC_ALL=C awk '!/^#/ && ($3 ~ "lustre") { print $2 }' /proc/mounts`
69 # See how we were called.
72 [ -n "$LUSTREFSTAB" ] && lustre_action $"Mounting Lustre filesystems: " mount -a -t lustre
73 touch /var/lock/subsys/lustrefs
76 [ -n "$LUSTREMTAB" ] && {
79 remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^lustre/ && $2 != "/" {print $2}' /proc/mounts`
80 while [ -n "$remaining" -a "$retry" -gt 0 ]
82 if [ "$retry" -lt 3 ]; then
83 lustre_action $"Unmounting Lustre filesystems (retry): " umount -f -a -t lustre
85 lustre_action $"Unmounting Lustre filesystems: " umount -a -t lustre
88 remaining=`LC_ALL=C awk '!/^#/ && $3 ~ /^lustre/ && $2 != "/" {print $2}' /proc/mounts`
89 [ -z "$remaining" ] && break
90 $FUSER -k -m $sig $remaining >/dev/null
96 rm -f /var/lock/subsys/lustrefs
99 if [ -f /proc/mounts ] ; then
100 [ -n "$LUSTREFSTAB" ] && {
101 echo $"Configured Lustre mountpoints: "
102 for fs in $LUSTREFSTAB; do echo $fs ; done
104 [ -n "$LUSTREMTAB" ] && {
105 echo $"Active Lustre mountpoints: "
106 for fs in $LUSTREMTAB; do echo $fs ; done
109 echo $"/proc filesystem unavailable"
120 echo $"Usage: $0 {start|stop|restart|reload|status}"