Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 549854 - dev-db/mysql-init-scripts logrotate script overrides user-set values
Summary: dev-db/mysql-init-scripts logrotate script overrides user-set values
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-18 20:34 UTC by Dimitrios Semitsoglou-Tsiapos
Modified: 2015-05-18 23:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitrios Semitsoglou-Tsiapos 2015-05-18 20:34:00 UTC
The logrotate script that ships with mysql overrides the following variables which a user may want to set globally in /etc/logrotate.conf:

monthly -- Combined with the user's `rotate` setting this will affect when logs are deleted.
size 5M -- Dangerous. This also indirectly dictates when logs are deleted.

A few more points:

* Global configuration is important for predictability and scripting.

* If size on the filesystem is a concern, the user can:
  * set e-mail warnings
  * set filesize-based rotation limits
  * enable compression only for logs which he or she expects to grow

* Logs are a security measure.

Reproducible: Always
Comment 1 Brian Evans (RETIRED) gentoo-dev 2015-05-18 20:51:48 UTC
First off, you mentioned the wrong package.

(In reply to Dimitrios Semitsoglou-Tsiapos from comment #0)
> The logrotate script that ships with mysql overrides the following variables
> which a user may want to set globally in /etc/logrotate.conf:
> 
> monthly -- Combined with the user's `rotate` setting this will affect when
> logs are deleted.
> size 5M -- Dangerous. This also indirectly dictates when logs are deleted.
> 
> A few more points:
> 
> * Global configuration is important for predictability and scripting.
> 
> * If size on the filesystem is a concern, the user can:
>   * set e-mail warnings
>   * set filesize-based rotation limits
>   * enable compression only for logs which he or she expects to grow
> 
> * Logs are a security measure.


I feel you have a deep misunderstanding of what the error log contains and filing this randomly.  My initial instinct is to close as WONTFIX but will discuss.

The error log mentioned in the default rotate script is one that shows the startup and shutdown of the server.  Very rarely, it may have a real error with a crash.  On Gentoo, this often does *not* have a backtrace as the information is stripped out by default.

The user can take advantage of whatever setting they need by changing the server's log-error setting and writing their own rotate script.
Comment 2 Dimitrios Semitsoglou-Tsiapos 2015-05-18 21:18:47 UTC
(In reply to Brian Evans from comment #1)
> First off, you mentioned the wrong package.
> 
> (In reply to Dimitrios Semitsoglou-Tsiapos from comment #0)
> > The logrotate script that ships with mysql overrides the following variables
> > which a user may want to set globally in /etc/logrotate.conf:
> > 
> > monthly -- Combined with the user's `rotate` setting this will affect when
> > logs are deleted.
> > size 5M -- Dangerous. This also indirectly dictates when logs are deleted.
> > 
> > A few more points:
> > 
> > * Global configuration is important for predictability and scripting.
> > 
> > * If size on the filesystem is a concern, the user can:
> >   * set e-mail warnings
> >   * set filesize-based rotation limits
> >   * enable compression only for logs which he or she expects to grow
> > 
> > * Logs are a security measure.
> 
> 
> I feel you have a deep misunderstanding of what the error log contains and
> filing this randomly.  My initial instinct is to close as WONTFIX but will
> discuss.
>
> The error log mentioned in the default rotate script is one that shows the
> startup and shutdown of the server.  Very rarely, it may have a real error
> with a crash.  On Gentoo, this often does *not* have a backtrace as the
> information is stripped out by default.

On a system of mine, /var/log/mysql/mysqld.err indeed is not so populated; but it contains lock issues, bad argument warnings, schema structure issues and IP resolution warnings. Granted, it is not a terribly big file, but this information can be proven a valuable source of information for solving problems down the line.

> The user can take advantage of whatever setting they need by changing the
> server's log-error setting and writing their own rotate script.

The reason why I opened issues on logrotate scripts such as this is the predictability of the presence of all logs regardless of their contents via a single setting that installing packages will not override.

I am not a sysadmin and by no means knowledgeable in maintaining databases - the idea is that if there is no driving force behind applying a change on someone's system, it will not necessarily be welcome.
Comment 3 Brian Evans (RETIRED) gentoo-dev 2015-05-18 23:08:20 UTC
(In reply to Dimitrios Semitsoglou-Tsiapos from comment #2)
> (In reply to Brian Evans from comment #1)
> > The user can take advantage of whatever setting they need by changing the
> > server's log-error setting and writing their own rotate script.
> 
> The reason why I opened issues on logrotate scripts such as this is the
> predictability of the presence of all logs regardless of their contents via
> a single setting that installing packages will not override.
> 
> I am not a sysadmin and by no means knowledgeable in maintaining databases -
> the idea is that if there is no driving force behind applying a change on
> someone's system, it will not necessarily be welcome.

If you don't like the settings in /etc/logrotate.d/mysql, then change them.
We provide the basics and reinstalling the package won't remove the changes.
This is why Gentoo has CONFIG_PROTECT on most of /etc/* by default