Bläddra i källkod

no need to interrupt operation by stop/start in order to rotate logs

Christoph Schug 19 år sedan
förälder
incheckning
223db725fa
6 ändrade filer med 24 tillägg och 15 borttagningar
  1. 1 1
      mysql/mysql.spec
  2. 7 4
      mysql/rc.mysql
  3. 1 1
      mysql4/mysql4.spec
  4. 7 4
      mysql4/rc.mysql
  5. 1 1
      mysql51/mysql51.spec
  6. 7 4
      mysql51/rc.mysql

+ 1 - 1
mysql/mysql.spec

@@ -39,7 +39,7 @@ Class:        BASE
 Group:        Database
 License:      GPL
 Version:      %{V_opkg}
-Release:      20061024
+Release:      20061026
 
 #   package options
 %option       with_server      yes

+ 7 - 4
mysql/rc.mysql

@@ -28,6 +28,11 @@
     mysql_err_log=@l_prefix@/var/mysql/mysqld.err
     mysql_common_log=@l_prefix@/var/mysql/common.log
     mysql_update_log=@l_prefix@/var/mysql/update.log
+    mysql_flush_logs () {
+        HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
+            --defaults-extra-file=${mysql_pwd_file} \
+            flush-logs
+    }
 
 %status -u @l_susr@ -o
     mysql_usable="unknown"
@@ -54,9 +59,7 @@
 %stop -p 600 -u @l_susr@
     rcService mysql enable yes || exit 0
     rcService mysql active no  && exit 0
-    HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
-        --defaults-extra-file=${mysql_pwd_file} \
-        flush-logs
+    mysql_flush_logs
     HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
         --defaults-extra-file=${mysql_pwd_file} \
         shutdown
@@ -89,7 +92,7 @@
         -E "${mysql_err_epilog}; echo 1 >$hintfile" \
         ${mysql_err_log}
     if [ -s $hintfile ]; then
-        rc mysql restart
+        mysql_flush_logs
     fi
     rcTmp -k
 

+ 1 - 1
mysql4/mysql4.spec

@@ -39,7 +39,7 @@ Class:        EVAL
 Group:        Database
 License:      GPL
 Version:      %{V_opkg}
-Release:      20061024
+Release:      20061026
 
 #   package options
 %option       with_server    yes

+ 7 - 4
mysql4/rc.mysql

@@ -28,6 +28,11 @@
     mysql_err_log=@l_prefix@/var/mysql/mysqld.err
     mysql_common_log=@l_prefix@/var/mysql/common.log
     mysql_update_log=@l_prefix@/var/mysql/update.log
+    mysql_flush_logs () {
+        HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
+            --defaults-extra-file=${mysql_pwd_file} \
+            flush-logs
+    }
 
 %status -u @l_susr@ -o
     mysql_usable="unknown"
@@ -54,9 +59,7 @@
 %stop -p 600 -u @l_susr@
     rcService mysql enable yes || exit 0
     rcService mysql active no  && exit 0
-    HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
-        --defaults-extra-file=${mysql_pwd_file} \
-        flush-logs
+    mysql_flush_logs
     HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
         --defaults-extra-file=${mysql_pwd_file} \
         shutdown
@@ -89,7 +92,7 @@
         -E "${mysql_err_epilog}; echo 1 >$hintfile" \
         ${mysql_err_log}
     if [ -s $hintfile ]; then
-        rc mysql restart
+        mysql_flush_logs
     fi
     rcTmp -k
 

+ 1 - 1
mysql51/mysql51.spec

@@ -39,7 +39,7 @@ Class:        EVAL
 Group:        Database
 License:      GPL
 Version:      %{V_opkg}
-Release:      20061024
+Release:      20061026
 
 #   package options
 %option       with_server      yes

+ 7 - 4
mysql51/rc.mysql

@@ -22,6 +22,11 @@
     mysql_pid_file=@l_prefix@/var/mysql/mysqld.pid
     mysql_err_log=@l_prefix@/var/mysql/mysqld.err
     mysql_common_log=@l_prefix@/var/mysql/common.log
+    mysql_flush_logs () {
+        HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
+            --defaults-extra-file=${mysql_pwd_file} \
+            flush-logs
+    }
 
 %status -u @l_susr@ -o
     mysql_usable="unknown"
@@ -48,9 +53,7 @@
 %stop -p 600 -u @l_susr@
     rcService mysql enable yes || exit 0
     rcService mysql active no  && exit 0
-    HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
-        --defaults-extra-file=${mysql_pwd_file} \
-        flush-logs
+    mysql_flush_logs
     HOME=@l_prefix@/etc/mysql @l_prefix@/bin/mysqladmin \
         --defaults-extra-file=${mysql_pwd_file} \
         shutdown
@@ -77,7 +80,7 @@
         -E "${mysql_err_epilog}; echo 1 >$hintfile" \
         ${mysql_err_log}
     if [ -s $hintfile ]; then
-        rc mysql restart
+        mysql_flush_logs
     fi
     rcTmp -k