Whamcloud - gitweb
b=16098
[fs/lustre-release.git] / lustre / scripts / nodelustre
1 #! /bin/sh
2 # nodelustre - Start and stop Lustre on MCR nodes
3 # Copyright 2008 Sun Microsystems, Inc.
4 # Gord Eagle <gord@clusterfs.com>, 2002-09-10
5
6 # Set this to the shared config file.
7 MASTER_CONFIG=http://emcri/lustre.xml
8 CONFIG=/etc/lustre/lustre.xml
9 COMPUTE_NODE=client
10
11 LCONF=/usr/local/cfs/lustre/utils/lconf
12 WGET=wget
13
14 case "$1" in
15 start | stop)
16   # Fetch the config file.  We can't use --output-document because it
17   # makes Wget ignore timestamping.
18   if test -n "$MASTER_CONFIG"; then
19     (cd `echo "$CONFIG" | sed 's%/[^/]*$%%'` && \
20       $WGET --timestamping "$MASTER_CONFIG") || exit $?
21   fi
22
23   # Map all client nodes to the COMPUTE_NODE virtual node.
24   if test -n "$COMPUTE_NODE" && nodeattr compute; then
25     node=" --node $COMPUTE_NODE"
26   else
27     node=
28   fi
29
30   # If we're stopping, do the lconf cleanup.
31   if test "$1" = stop; then
32     cleanup=' --cleanup'
33   else
34     cleanup=
35   fi
36
37   $LCONF$cleanup$node "$CONFIG"
38   ;;
39
40 *)
41   echo "$0 {start|stop}" 1>&2
42   exit 1
43   ;;
44 esac
45
46 exit 0