Whamcloud - gitweb
- add lustre initscript
authorrread <rread>
Fri, 12 Jul 2002 09:21:30 +0000 (09:21 +0000)
committerrread <rread>
Fri, 12 Jul 2002 09:21:30 +0000 (09:21 +0000)
lustre/scripts/Makefile.am
lustre/scripts/lustre [new file with mode: 0755]
lustre/scripts/lustre.spec.in

index 5f8bb20..050f583 100644 (file)
@@ -3,6 +3,8 @@
 # This code is issued under the GNU General Public License.
 # See the file COPYING in this distribution
 
-EXTRA_DIST = license-status maketags.sh mkobddevs obdtrace_demo.scr lustre.spec
+EXTRA_DIST = license-status maketags.sh mkobddevs obdtrace_demo.scr lustre.spec $(initd_SCRIPTS)
+initddir = $(sysconfdir)/init.d
+initd_SCRIPTS = lustre
 include $(top_srcdir)/Rules
 
diff --git a/lustre/scripts/lustre b/lustre/scripts/lustre
new file mode 100755 (executable)
index 0000000..90372ff
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/bash
+#
+# lustre   This shell script takes care of starting and stopping Lustre
+#
+# chkconfig: 2345 99 1
+# description: Lustre Lite File System
+# processname: obdctl
+# config: /etc/lustre/lustre.cfg
+# pidfile: /var/run/lustre.pid
+
+# Source function library.
+if [ -f /etc/init.d/functions ] ; then
+   . /etc/init.d/functions
+fi
+
+# Source networking configuration.
+if [ -f /etc/sysconfig/network ] ; then
+   . /etc/sysconfig/network
+fi
+
+# Source InterSync configureation.
+if [ -f /etc/sysconfig/intersync ] ; then
+       . /etc/sysconfig/intersync
+else
+       CLIENT_OPTS=
+        CACHE=/var/intermezzo/cache
+fi
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+[ -f /usr/sbin/obdctl ] || exit 0
+
+start() {
+        echo -n $"Starting lustre: "
+       /usr/sbin/llrsetup.sh
+        echo -n lustre
+        RETVAL=$?
+        [ $RETVAL = 0 ] && touch /var/lock/subsys/lustre
+}
+
+stop() {
+        echo -n $"Shutting down lustre: "
+       /usr/sbin/llcleanup.sh
+       echo -n lustre              
+       echo
+       rm -f /var/lock/subsys/intersync
+}
+
+restart() {
+       stop
+       start
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       restart
+       ;;
+  status)
+       status intersync
+       ;;
+  *)
+       echo $"Usage: lustre {start|stop|restart|status}"
+       exit 1
+esac
+
+exit $RETVAL
+
index 1ed8f12..81165b1 100644 (file)
@@ -62,6 +62,7 @@ find . -print | cpio -ap  $RPM_BUILD_ROOT/usr/src/lustre-%{version}
 %attr(-, root, root) /usr/sbin/llcleanup.sh
 %attr(-, root, root) /lib/lustre/common.sh
 %attr(-, root, root) /etc/lustre/lustre.cfg
+%attr(-, root, root) /etc/init.d/lustre
 
 %files -n lustre-modules
 %attr(-, root, root) %doc COPYING