3 # /etc/rc.d/mysqld: start/stop mysqld daemon
6 SSD
=/sbin
/start-stop-daemon
9 PID
=$
(sed -n 's/^pid-file[ \t]*=[ \t]*//p' $MYSQL_CFG)
10 USR
=$
(sed -n 's/^user[ \t]*=[ \t]*//p' $MYSQL_CFG)
14 touch $PID && chown
$USR:$USR $PID
15 $SSD --start --background --pidfile $PID --exec $PROG
18 $SSD --stop --remove-pidfile --retry 10 --pidfile $PID
25 $SSD --status --pidfile $PID
27 0) echo "$PROG is running with pid $(cat $PID)" ;;
28 1) echo "$PROG is not running but the pid file $PID exists" ;;
29 3) echo "$PROG is not running" ;;
30 4) echo "Unable to determine the program status" ;;
34 echo "usage: $0 [start|stop|restart|status]"