Whamcloud - gitweb
- add lustre initscript
[fs/lustre-release.git] / lustre / scripts / lustre
1 #!/bin/bash
2 #
3 # lustre   This shell script takes care of starting and stopping Lustre
4 #
5 # chkconfig: 2345 99 1
6 # description: Lustre Lite File System
7 # processname: obdctl
8 # config: /etc/lustre/lustre.cfg
9 # pidfile: /var/run/lustre.pid
10
11 # Source function library.
12 if [ -f /etc/init.d/functions ] ; then
13    . /etc/init.d/functions
14 fi
15
16 # Source networking configuration.
17 if [ -f /etc/sysconfig/network ] ; then
18    . /etc/sysconfig/network
19 fi
20
21 # Source InterSync configureation.
22 if [ -f /etc/sysconfig/intersync ] ; then
23         . /etc/sysconfig/intersync
24 else
25         CLIENT_OPTS=
26         CACHE=/var/intermezzo/cache
27 fi
28
29 # Check that networking is up.
30 [ "${NETWORKING}" = "no" ] && exit 0
31
32 [ -f /usr/sbin/obdctl ] || exit 0
33
34 start() {
35         echo -n $"Starting lustre: "
36         /usr/sbin/llrsetup.sh
37         echo -n lustre
38         RETVAL=$?
39         [ $RETVAL = 0 ] && touch /var/lock/subsys/lustre
40 }
41
42 stop() {
43         echo -n $"Shutting down lustre: "
44         /usr/sbin/llcleanup.sh
45         echo -n lustre              
46         echo
47         rm -f /var/lock/subsys/intersync
48 }
49
50 restart() {
51         stop
52         start
53 }
54
55 # See how we were called.
56 case "$1" in
57   start)
58         start
59         ;;
60   stop)
61         stop
62         ;;
63   restart)
64         restart
65         ;;
66   status)
67         status intersync
68         ;;
69   *)
70         echo $"Usage: lustre {start|stop|restart|status}"
71         exit 1
72 esac
73
74 exit $RETVAL
75