Whamcloud - gitweb
* init script designed for MCR by Gord Eagle, and a useful example
authorrread <rread>
Wed, 6 Nov 2002 07:49:02 +0000 (07:49 +0000)
committerrread <rread>
Wed, 6 Nov 2002 07:49:02 +0000 (07:49 +0000)
lustre/scripts/nodelustre [new file with mode: 0755]

diff --git a/lustre/scripts/nodelustre b/lustre/scripts/nodelustre
new file mode 100755 (executable)
index 0000000..b5e6540
--- /dev/null
@@ -0,0 +1,46 @@
+#! /bin/sh
+# nodelustre - Start and stop Lustre on MCR nodes
+# Copyright (C) 2002  Cluster File Systems, Inc.
+# Gord Eagle <gord@clusterfs.com>, 2002-09-10
+
+# Set this to the shared config file.
+MASTER_CONFIG=http://emcri/lustre.xml
+CONFIG=/etc/lustre/lustre.xml
+COMPUTE_NODE=client
+
+LCONF=/usr/local/cfs/lustre/utils/lconf
+WGET=wget
+
+case "$1" in
+start | stop)
+  # Fetch the config file.  We can't use --output-document because it
+  # makes Wget ignore timestamping.
+  if test -n "$MASTER_CONFIG"; then
+    (cd `echo "$CONFIG" | sed 's%/[^/]*$%%'` && \
+      $WGET --timestamping "$MASTER_CONFIG") || exit $?
+  fi
+
+  # Map all client nodes to the COMPUTE_NODE virtual node.
+  if test -n "$COMPUTE_NODE" && nodeattr compute; then
+    node=" --node $COMPUTE_NODE"
+  else
+    node=
+  fi
+
+  # If we're stopping, do the lconf cleanup.
+  if test "$1" = stop; then
+    cleanup=' --cleanup'
+  else
+    cleanup=
+  fi
+
+  $LCONF$cleanup$node "$CONFIG"
+  ;;
+
+*)
+  echo "$0 {start|stop}" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0