]>
Commit | Line | Data |
---|---|---|
36eada1b AM |
1 | #!/bin/sh |
2 | # | |
3 | # mysql-ndb-cpc This shell script takes care of starting and stopping mysql-ndb-cpc. | |
4 | # | |
5 | # chkconfig: 2345 80 30 | |
6 | # description: mysql-ndb-cpc is a mysql NDB engine | |
7 | # | |
8 | # processname: ndbd | |
9 | ||
10 | # Source function library. | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Source networking configuration. | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Source oident configureation. | |
17 | if [ -f /etc/sysconfig/mysql-ndb-cpc ]; then | |
18 | . /etc/sysconfig/mysql-ndb-cpc | |
19 | fi | |
20 | ||
21 | # Check that networking is up. | |
22 | if is_yes "${NETWORKING}"; then | |
23 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then | |
24 | msg_network_down mysql-ndb-cpc | |
25 | exit 1 | |
26 | fi | |
27 | else | |
28 | exit 0 | |
29 | fi | |
30 | ||
31 | RETVAL=0 | |
32 | # See how we were called. | |
33 | case "$1" in | |
34 | start) | |
35 | # Start daemons. | |
36 | if [ ! -f /var/lock/subsys/mysql-ndb-cpc ]; then | |
37 | msg_starting "mysql ndb_cpcd" | |
38 | daemon ndb_cpcd $MYSQL_NDB_CPC_OPT | |
39 | RETVAL=$? | |
40 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mysql-ndb-cpc | |
41 | else | |
42 | msg_already_running "mysql ndb_cpcd" | |
43 | fi | |
44 | ;; | |
45 | stop) | |
46 | # Stop daemons. | |
47 | if [ -f /var/lock/subsys/mysql-ndb-cpc ]; then | |
48 | msg_stopping "mysql ndb_cpcd" | |
49 | killproc ndbd | |
50 | rm -f /var/lock/subsys/mysql-ndb-cpc >/dev/null 2>&1 | |
51 | else | |
52 | msg_not_running "mysql ndb_cpcd" | |
53 | fi | |
54 | ;; | |
55 | restart|force-reload) | |
56 | $0 stop | |
57 | $0 start | |
58 | exit $? | |
59 | ;; | |
60 | status) | |
61 | status ndb_cpcd | |
62 | exit $? | |
63 | ;; | |
64 | # reload) | |
65 | # msg_reloading "mysql ndb_cpcd" | |
66 | # killproc ndb_cpcd -HUP | |
67 | # ;; | |
68 | *) | |
69 | msg_usage "$0 {start|stop|restart|force-reload|status}" | |
70 | exit 3 | |
71 | esac | |
72 | ||
73 | exit $RETVAL |