I'm having a problem with logrotate rotating MySQL files and flushing the server properly. My current file looks like this:
/var/lib/mysql/mysql.log { notifempty daily rotate 14 olddir /var/lib/mysql/old_logs missingok compress postrotate if test -n "`ps acx|grep mysqld`"; then /usr/bin/mysqladmin flush-logs fi endscript }
As per MySQL's instructions, I also have a /roof/.my.cnf file that
contains the user and password to connect to the server (readable only
by root.) However, when logrotate runs through cron, either it doesn't
see this file, or it's not running with proper environment, I don't
know. Point is, logrotate bombs with an error during the postrotate
routine because it can't connect to the MySQL server (no password
given). However, if I run logrotate manually from the command line, it
runs just fine and rotates the log file without any problem (it doesn't ask for the password because it can see the .my.cnf file in /root.
Anyone got any ideas?
-- H| I haven't lost my mind; it's backed up on tape somewhere. +-------------------------------------------------------------------- Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130 IT Director / SysAdmin / WebSmith . 800.441.3873 x130 Photo Craft Laboratories, Inc. . 3550 Arapahoe Ave. #6 http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.
-- redhat-list mailing list unsubscribe mailto:[EMAIL PROTECTED] https://www.redhat.com/mailman/listinfo/redhat-list