]> git.pld-linux.org Git - packages/mysql.git/commitdiff
- make mysql.init a bit more lsb-compatible
authorMariusz Mazur <mmazur@pld-linux.org>
Wed, 27 Jul 2011 13:34:24 +0000 (13:34 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- when running `mysql status` on a server where /var/lib/mysql isn't mounted,
  don't return 6 (AAAAA!!!!! UNKNOWN ERROR!!!!!), but 3 (everythin' cool,
  service just not running, move along)

Changed files:
    mysql.init -> 1.148

mysql.init

index cddfede6b25aa08e0f9968affb3851a3a7ca8cfb..9b43c19b99056e7b42f60285f235eb827419ac8d 100644 (file)
@@ -102,7 +102,7 @@ mysqlstatus() {
        clusterdir="$1"
        mode="$2"
        
-       mysqlgetconfig "$clusterdir"
+       mysqlgetconfig "$clusterdir" status
 
        MYSQL_STATUS="not running"
        MYSQL_PID="unknown"
@@ -153,9 +153,11 @@ mysqlstatus() {
 #
 # arguments
 # $1 - db cluster
+# $2 - status | other
 
 mysqlgetconfig() {
        local clusterdir="$1" config_file
+       local mode="$2"
 
        # emulate old behaviour if only one cluster specified
        if [ "$clusterdir" = "$MYSQL_DB_CLUSTERS" -a "$clusterdir" = "/var/lib/mysql" -a -f /etc/mysqld.conf ]; then
@@ -176,7 +178,11 @@ mysqlgetconfig() {
 
        if [ -z "$config_file" ]; then
                nls "Error: Can't find config file for %s cluster" "$clusterdir"
-               exit 6
+               if [ "$mode" = "status" ]; then 
+                       exit 3
+               else
+                       exit 6
+               fi
        else
                MYSQL_CONFIG="$config_file"
        fi
@@ -184,7 +190,11 @@ mysqlgetconfig() {
        if [ ! -f "$config_file" ]; then
                nls "Error: config file %s not found" "$config_file"
                nls "MySQL can't be run. Did you initialize DB by doing \`$0 init'?"
-               exit 6
+               if [ "$mode" = "status" ]; then 
+                       exit 3
+               else
+                       exit 6
+               fi
        fi
 
        # reset to initial state
This page took 0.059001 seconds and 4 git commands to generate.