ClearFoundation Tracker - ClearOS
View Issue Details
0000225ClearOSapp-mysql - MySQL Databasepublic2011-02-06 07:522019-03-12 04:21
NickH 
 
normaltweakhave not tried
closedsuspended 
5.2-SP1 
 
0000225: MySQL log does not rotate
I recently noticed in 07/2009 mysqld.log ceased to rotate. This was probably in the transition from CC4.3 to CC5.0.

There is no entry in logrotate.conf or /etc/logrotate.d to force log rotation. It is the same on both my production server and my play VM.
No tags attached.
Issue History
2011-02-06 07:52NickHNew Issue
2011-02-07 20:34user2Statusnew => acknowledged
2013-02-02 09:42user2Target Version => 6.4.0 Beta 2
2013-02-21 20:00user2Target Version6.4.0 Beta 2 => 6.4.0
2013-03-14 11:56user2Target Version6.4.0 => 6.4.0 Updates
2013-04-30 14:29user2Issue cloned: 0001129
2013-05-01 05:07NickHNote Added: 0000836
2013-05-01 05:08NickHNote Added: 0000838
2013-07-29 13:58user2Target Version6.4.0 Updates => 6 Future
2014-02-10 08:03user2Note Added: 0001143
2014-02-10 08:04user2Target Version6 Future => 6.5.0 Updates
2014-02-10 08:05user2Target Version6.5.0 Updates => 6.6.0 Beta 1
2014-05-08 08:09user2Target Version6.6.0 Beta 1 => 6.6.0 Beta 2
2014-05-28 20:04user2Note Added: 0001187
2014-05-30 13:46user2Severitytrivial => tweak
2014-06-23 10:34user2Target Version6.6.0 Beta 2 => 6.6.0 Beta 3
2014-08-27 14:23user2Target Version6.6.0 Beta 3 => 7.0.0 Alpha 2
2014-10-21 15:28user2Target Version7.0.0 Alpha 2 => 7.1.0 Beta 2
2015-01-29 12:47user2Note Added: 0001357
2015-01-29 12:47user2Target Version7.1.0 Beta 2 =>
2019-03-12 04:21NickHNote Added: 0010911
2019-03-12 04:21NickHStatusacknowledged => closed
2019-03-12 04:21NickHResolutionopen => suspended

Notes
(0000836)
NickH   
2013-05-01 05:07   
system-mysql.log used to rotate in 5.2 but with a logrotate function a bit different from normal logrotate functions:

/var/log/system-mysql/mysqld.log {
    missingok
    create 0640 system-mysql system-mysql
    prerotate
    [ -e /var/lock/subsys/system-mysqld ] && /bin/kill -HUP `cat /var/run/system-mysqld/system-mysqld.pid 2> /dev/null ` || /bin/true
    endscript
    postrotate
    [ -e /var/lock/subsys/system-mysqld ] && /bin/kill -HUP `cat /var/run/system-mysqld/system-mysqld.pid 2> /dev/null ` || /bin/true
    endscript
}
(0000838)
NickH   
2013-05-01 05:08   
Sorry. Comment added to wrong bug
(0001143)
user2   
2014-02-10 08:03   
This was semi-resolved in a recent upstream update. See "Details" section in upstream errata report:

https://rhn.redhat.com/errata/RHBA-2013-1647.html [^]

 The script to rotate the logs is included, but disabled. We'll add a little hook in the ClearOS MySQL app to enable/disable the script from the GUI.
(0001187)
user2   
2014-05-28 20:04   
The upstream logrotate configlet is below. As you can see, the script requires the database root password to be stored in /root/.my.cnf. That's messy. Instead of requiring the password, a full MySQL restart could be done instead? That's not ideal either.


// Begin configlet

# This logname can be set in /etc/my.cnf
# by setting the variable "err-log"
# in the [safe_mysqld] section as follows:
#
# [safe_mysqld]
# err-log=/var/log/mysqld.log
#
# If the root user has a password you have to create a
# /root/.my.cnf configuration file with the following
# content:
#
# [mysqladmin]
# password = <secret>
# user= root
#
# where "<secret>" is the password.
#
# ATTENTION: This /root/.my.cnf should be readable ONLY
# for root !

# Then, un-comment the following lines to enable rotation of mysql's log file:

#/var/log/mysqld.log {
# create 640 mysql mysql
# notifempty
# daily
# rotate 3
# missingok
# compress
# postrotate
# # just if mysqld is really running
# if test -x /usr/bin/mysqladmin && \
# /usr/bin/mysqladmin ping &>/dev/null
# then
# /usr/bin/mysqladmin flush-logs
# fi
# endscript
#}
(0001357)
user2   
2015-01-29 12:47   
Due to the added complexity, we're bumping this request to a later release.
(0010911)
NickH   
2019-03-12 04:21   
Migrated to: https://gitlab.com/clearos/clearfoundation/app-mariadb/issues/1 [^]