Magellan Linux

Annotation of /trunk/mysql5/mysql.rc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1372 - (hide annotations) (download)
Wed Jun 29 07:14:08 2011 UTC (12 years, 10 months ago) by niro
File size: 817 byte(s)
-use rc_print() functions
1 niro 245 #!/bin/bash
2 niro 864 # $Header: /root/magellan-cvs/src/mysql5/mysql.rc,v 1.3 2009-07-06 17:48:07 niro Exp $
3 niro 245
4     #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k
5     #%start: 60
6     #%stop: 80
7    
8     #deps
9     #%needs:
10     #%before:
11     #%after:
12    
13 niro 864 source /etc/conf.d/rc
14 niro 245 source $rc_functions
15    
16     case "$1" in
17     start)
18 niro 1372 rc_print "Starting mysql daemon ..."
19 niro 246 /usr/bin/mysqld_safe > /dev/null 2>&1 &
20 niro 245 evaluate_retval
21    
22     update_svcstatus $1
23     splash svc_started "$(basename $0)" 0
24     ;;
25    
26     stop)
27 niro 1372 rc_print "Stopping mysql daemon ..."
28 niro 245 start-stop-daemon --stop --quiet \
29     --pidfile=/var/run/mysqld/mysqld.pid --retry 20
30     evaluate_retval
31    
32     update_svcstatus $1
33     splash svc_stopped "$(basename $0)" 0
34     ;;
35    
36     restart)
37     $0 stop
38     sleep 1
39     $0 start
40     ;;
41    
42     status)
43     statusproc /usr/sbin/mysqld
44     ;;
45    
46     *)
47 niro 1372 rc_echo "Usage: $0 {start|stop|restart|status}"
48 niro 245 exit 1
49     ;;
50     esac