From 9168c57d1c286329a94cf1f9dfbeb741d801f109 Mon Sep 17 00:00:00 2001 From: rread Date: Fri, 12 Jul 2002 09:21:30 +0000 Subject: [PATCH] - add lustre initscript --- lustre/scripts/Makefile.am | 4 ++- lustre/scripts/lustre | 75 +++++++++++++++++++++++++++++++++++++++++++ lustre/scripts/lustre.spec.in | 1 + 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100755 lustre/scripts/lustre diff --git a/lustre/scripts/Makefile.am b/lustre/scripts/Makefile.am index 5f8bb20..050f583 100644 --- a/lustre/scripts/Makefile.am +++ b/lustre/scripts/Makefile.am @@ -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 index 0000000..90372ff --- /dev/null +++ b/lustre/scripts/lustre @@ -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 + diff --git a/lustre/scripts/lustre.spec.in b/lustre/scripts/lustre.spec.in index 1ed8f12..81165b1 100644 --- a/lustre/scripts/lustre.spec.in +++ b/lustre/scripts/lustre.spec.in @@ -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 -- 1.8.3.1