mysql: fix initscript
authorJo-Philipp Wich <jow@openwrt.org>
Tue, 14 Dec 2010 13:59:47 +0000 (13:59 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Tue, 14 Dec 2010 13:59:47 +0000 (13:59 +0000)
SVN-Revision: 24565

libs/mysql/files/mysqld.init

index d3edd1521e8ff322a8c3df634ef2240482f410a8..e3088a342deb10505b524191159eb07a2229a62e 100644 (file)
@@ -13,21 +13,15 @@ start() {
        echo "Error: datadir in /etc/my.cnf ($DATADIR) doesn't exist"
        return 1
     elif [ ! -f $DATADIR/mysql/tables_priv.MYD ]; then
-       echo "Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables"
-       return 1
+               echo "Error: I didn't detect a privileges table, you might need to run mysql_install_db --force to initialize the system tables"
+               return 1
     else
-       start-stop-daemon -x $CMD -p $PID -b -m -S
+               start-stop-daemon -x $CMD -b -S -- --pid-file=$PID
     fi
 }
 
 stop() {
     echo -n "Stopping Mysqld..."
-    start-stop-daemon -x $CMD -p $PID -K
-    ret=$?
-    if [ -f "$PID" ]; then
-        rm "$PID"
-    fi
-    return ${ret}
+    service_kill ${CMD##*/} $PID
+    echo "done"
 }
-
-