Commit | Line | Data |
---|---|---|
825e3023 VM |
1 | #!/bin/sh |
2 | # | |
3 | # /etc/rc.d/mysqld: start/stop mysqld daemon | |
4 | # | |
5 | ||
199f2d02 VM |
6 | SSD=/sbin/start-stop-daemon |
7 | PROG=/usr/sbin/mysqld | |
825e3023 | 8 | MYSQL_CFG=/etc/my.cnf |
9e74ef3a VM |
9 | PID=/var/run/mysql/mysqld.pid |
10 | LOG=/var/log/mysqld.log | |
825e3023 VM |
11 | |
12 | case $1 in | |
13 | start) | |
9e74ef3a | 14 | $SSD --start -bC --pidfile $PID --exec $PROG >> $LOG 2>&1 |
825e3023 VM |
15 | ;; |
16 | stop) | |
199f2d02 | 17 | $SSD --stop --remove-pidfile --retry 10 --pidfile $PID |
825e3023 VM |
18 | ;; |
19 | restart) | |
20 | $0 stop | |
825e3023 VM |
21 | $0 start |
22 | ;; | |
199f2d02 VM |
23 | status) |
24 | $SSD --status --pidfile $PID | |
25 | case $? in | |
26 | 0) echo "$PROG is running with pid $(cat $PID)" ;; | |
27 | 1) echo "$PROG is not running but the pid file $PID exists" ;; | |
28 | 3) echo "$PROG is not running" ;; | |
29 | 4) echo "Unable to determine the program status" ;; | |
30 | esac | |
31 | ;; | |
825e3023 | 32 | *) |
199f2d02 | 33 | echo "usage: $0 [start|stop|restart|status]" |
825e3023 VM |
34 | ;; |
35 | esac | |
36 | ||
37 | # End of file |