6 MYSQL_LIB
="/var/lib/mysql"
8 MYSQL_PID
="$MYSQL_RUN/mysqld.pid"
13 while [ $WAIT_DELAY -gt 0 ]; do
14 if $MYSQL_BIN/mysqladmin
ping > /dev
/null
2>&1; then
18 : $
((WAIT_DELAY
-= 1))
24 if [ `ls -1 $MYSQL_LIB | wc -l` = 0 ] ; then
25 printf "Creating mysql system tables ... "
26 $MYSQL_BIN/mysql_install_db
--basedir=/usr
--user=mysql \
27 --datadir=$MYSQL_LIB > /dev
/null
2>&1
35 # mysqld runs as user mysql, but /run is only writable by root
36 # so create a subdirectory for mysql.
37 install -d -o mysql
-g root
-m 0755 $MYSQL_RUN
39 # We don't use start-stop-daemon because mysqld has its own
41 printf "Starting mysql ... "
42 $MYSQL_BIN/mysqld_safe
--pid-file=$MYSQL_PID --user=mysql \
45 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
49 printf "Stopping mysql ... "
50 if [ -f $MYSQL_PID ]; then
51 kill `cat $MYSQL_PID` > /dev
/null
2>&1
52 [ $?
= 0 ] && echo "OK" ||
echo "FAIL"
75 echo "Usage: $0 {start|stop|restart}"