Changeset 24567


Ignore:
Timestamp:
2010-12-14T15:12:15+01:00 (7 years ago)
Author:
jow
Message:

[packages] mysql: further init script cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • packages/libs/mysql/files/mysqld.init

    r24565 r24567  
    11#!/bin/sh /etc/rc.common 
    22# Copyright (C) 2010 OpenWrt.org 
     3 
    34START=95 
    45STOP=10 
    5  
    66 
    77PID=/var/run/mysqld.pid 
     
    99 
    1010start() { 
    11     DATADIR=`grep datadir /etc/my.cnf | cut -f 2 -d =` 
    12     if [ !  -d $DATADIR ]; then 
    13         echo "Error: datadir in /etc/my.cnf ($DATADIR) doesn't exist" 
    14         return 1 
    15     elif [ ! -f $DATADIR/mysql/tables_priv.MYD ]; then 
     11        local datadir=$(sed -n -e 's/^[[:space:]]*datadir[[:space:]]*=[[:space:]]*//p' /etc/my.cnf) 
     12        if [ ! -d "$datadir" ]; then 
     13                echo "Error: datadir in /etc/my.cnf ($datadir) doesn't exist" 
     14                return 1 
     15        elif [ ! -f "$datadir/mysql/tables_priv.MYD" ]; then 
    1616                echo "Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables" 
    1717                return 1 
    18     else 
     18        else 
     19                echo -n "Starting MySQL daemon... " 
    1920                start-stop-daemon -x $CMD -b -S -- --pid-file=$PID 
    20     fi 
     21                echo "done" 
     22        fi 
    2123} 
    2224 
    2325stop() { 
    24     echo -n "Stopping Mysqld..." 
    25     service_kill ${CMD##*/} $PID 
    26     echo "done" 
     26        echo -n "Stopping MySQL daemon... " 
     27        service_kill ${CMD##*/} $PID 
     28        echo "done" 
    2729} 
Note: See TracChangeset for help on using the changeset viewer.