renaming
[sfa.git] / sfa / init.d / sfa-cm
1 #!/bin/bash
2 #
3 # sfa   Wraps PLCAPI into the SFA compliant API
4 #
5 # chkconfig: 2345 5 99
6 #
7 # description:   Wraps PLCAPI into the SFA compliant API
8 #
9 # $Id: sfa 14304 2009-07-06 20:19:51Z thierry $
10 # $URL: https://svn.planet-lab.org/svn/sfa/trunk/sfa/init.d/sfa $
11 #
12
13 # Source config
14 . /etc/sfa/sfa_config
15
16 # source function library
17 . /etc/init.d/functions
18
19
20 start() {
21         echo -n $"Starting SFA:  "
22
23         if [ "$SFA_CM_ENABLED" ]; then
24             echo "Component Mgr"
25             /usr/bin/sfa-server.py -c -d $OPTIONS
26         fi
27
28         RETVAL=$?
29         echo
30         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sfa
31
32 }
33
34 stop() {
35     echo -n $"Shutting down SFA: "
36     killproc sfa-server.py
37     RETVAL=$?
38
39     echo
40     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sfa
41 }
42
43
44
45 case "$1" in
46   start)
47     start
48     ;;
49   stop)
50     stop
51     ;;
52   restart|reload)
53     stop
54     start
55     ;;
56   condrestart)
57     if [ -f /var/lock/subsys/sfa ]; then
58         stop
59         start
60     fi
61     ;;
62   status)
63     status sfa
64     RETVAL=$?
65     ;;
66   *)
67     echo $"Usage: $0 {start|stop|restart|condrestart|status}"
68     exit 1
69 esac
70
71 exit $RETVAL
72