← Back to team overview

maria-discuss team mailing list archive

Re: mysqladmin - flush failed: Unknown error

 

I think you'll find that the mysql user don't have permissions to create
a new file in /var/log/. As such logrotate renames the file which is
still open by mysqld. As such it is now writing to mysqld.log.1.

On 28/03/17 00:13, Matthew Pash wrote:
> Hi,
> 
> We've got some database servers running MariaDB 10.1.22, and are having
> issues with logrotate.  Specifically, after it runs, it leaves a 0 byte
> file and continues writing log data to mysqld.log.1
> 
> Manually running logrotate in verbose mode shows this error from
> mysqladmin when it tries to run -flush_logs:
> 
> /usr/bin/mysqladmin: flush failed; error: 'Unknown error'
> error: error running non-shared postrotate script for
> /var/log/mysqld.log of '/var/log/mysqld.log '
> set default create context

What does the logrotate script look like? It really should be a "shared"
(in a logrotate way) script.

> Has anyone seen this before?  It doesn't look like a permissions error -
> the logs are created fine if you run systemctl restart mariadb.

Is the log actually writing to /var/log/mysqld.log using systemd? It
normally writes to the journal because with systemd redirects stderr there.


> Thanks,
> ~Matt
> 
> -- 
> *Matthew*
> Senior Systems Administrator, IT Services
> University of Bristol
> 
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~maria-discuss
> Post to     : maria-discuss@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~maria-discuss
> More help   : https://help.launchpad.net/ListHelp
> 



References