Horst,

I commented everything out of the /etc/log.rotate.d/daily/mysql and just
periodically restart the server from a crontab setting.  And, I use 
mysqldump on the same interval, for "rollback-like" capability.  I've 
had it going a couple of years; it's the manual way to do transactions, 
and my log files behave properly, mostly only recording the restarts.  
What works for me might not work for others depending on the data.
Newer versions of MySQL support transactions directly.

Ralph

At 06:58 PM 4/11/02 Horst <[EMAIL PROTECTED]> wrote:
>PROBLEM:
>cron.daily/weekly, logrote creates new  /var/log/mysqld.log 
>       but still writes to old  /var/log/mysqld.log.N (N = 1,2,...)
>
>I tried all kinds of :
> mysqladmin -u root -p refresh
> mysqladmin -u root -p flush-logs
> mysqladmin -u root -p status
> mysqladmin -u root -p flush-logs
> mysqladmin -u root -p flush-tables 
>
>
>SOME OBSERVATIONS:  (see clips from console)
>a) pid of mysqld is only 3byte (LF missing)
>b) the pid listed is not the hightest parent
>c) logrote instruction for mysql are quiet different from other processes
>x)020407  4:02:02  /usr/libexec/mysqld: Binlog closed, cannot RESET 
>MASTER
>
>'SOLUTION':
>The only cure is '.../mysqld restart' - currently run 1hr after 
>logrotate.
>But that's not a 'solution' I am proud of...
>
>Anybody an idea? ....................... Horst.
>
>MYSQL:
>=======================================
>[root@plutobin]# cat /etc/logrotate.d/mysqld
>/var/log/mysqld.log {
>    missingok
>    create 0640 mysql mysql
>    prerotate
>        [ -e /var/lock/subsys/mysqld ] && /bin/kill -HUP `/bin/cat 
>/var/run/mysqld/mysqld.pid` || /bin/true
>    endscript
>    postrotate
>        [ -e /var/lock/subsys/mysqld ] && /bin/kill -HUP `/bin/cat 
>/var/run/mysqld/mysqld.pid` || /bin/true
>    endscript
>}
>[root@plutobin]#
>
>[root@plutoadmin]# ll /var/run/mysqld/
>-rw-rw----    1 mysql    mysql           3 Apr  5 14:22 mysqld.pid
>
>[root@plutoadmin]# cat /var/run/mysqld/mysqld.pid
>582[root@plutoadmin]# ps -ef |grep mysql
>root       494     1  0 Apr05 ?        00:00:00 /bin/sh 
>/usr/bin/safe_mysqld --d
>mysql      547   494  0 Apr05 ?        00:00:07 /usr/libexec/mysqld --
>defaults-f
>mysql      581   547  0 Apr05 ?        00:00:09 /usr/libexec/mysqld --
>defaults-f
>mysql      582   581  0 Apr05 ?        00:00:15 /usr/libexec/mysqld --
>defaults-f
>mysql      591   581  0 Apr05 ?        00:00:00 /usr/libexec/mysqld --
>defaults-f
>root     20290 19418  0 10:41 pts/1    00:00:00 grep mysql
>
>
>OTHER:
>===============================
>[root@plutobin]# cat /etc/logrotate.d/named
>/var/log/named.log {
>    missingok
>    postrotate
>        /bin/kill -HUP `cat /var/run/named.pid 2> /dev/null` 2> /dev/null 
>|| tru
>e
>    endscript
>}
>
>[root@plutoadmin]# ll /var/run/named/
>-rw-r--r--    1 named    named           4 Apr  5 14:22 named.pid
>
>-rw-r--r--    1 root     root            4 Apr  7 04:02 httpd.pid
>
>[root@plutoadmin]# cat /var/run/httpd.pid
>930
>[root@plutoadmin]# ps -ef |grep httpd
>root       930     1  0 Apr05 ?        00:00:02 /usr/sbin/httpd -
>DHAVE_PROXY -DH
>web      18778   930  0 09:24 ?        00:00:00 /usr/sbin/httpd -
>DHAVE_PROXY -DH
>web      18781   930  0 09:24 ?        00:00:02 /usr/sbin/httpd -
>DHAVE_PROXY -DH
>web      18782   930  0 09:24 ?        00:00:01 /usr/sbin/httpd -
>DHAVE_PROXY -DH
>... many more
>
>~~~~~~~~~~~~~~~~~~ clip from the mysqld.log* ~~~~~~~~~~~~~~~~~~
>020407  4:02:02  /usr/libexec/mysqld: Binlog closed, cannot RESET MASTER
>
>Status information:
>
>Current locks:
>key_cache status:
>blocks used:      2317
>not flushed:         0
>w_requests:          0
>writes:              0
>r_requests:          0
>reads:               0
>
>handler status:
>read_key:            0
>read_next:           0
>read_rnd             0
>read_first:          0
>write:               0
>delete               0
>update:              0
>
>Table status:
>Opened tables:          0
>Open tables:            0
>Open files:             0
>Open streams:           0
>020407  4:02:02  /usr/libexec/mysqld: Binlog closed, cannot RESET MASTER
>
>

Reply via email to