Removed debian.cnf reference from logrotate/logcheck configuration Installed on Xenial/Stretch

Description

Hi

 

debian.cnf - it does not exists when you install PXC 5.7 on Xenial.

then non of init scripts or logrotate works properly 

a fix is to create the file by hand but this is not normal.

example on fresh ubuntu 

 

root@db4:/etc/logrotate.d# more percona-xtradb-cluster-server-5.7 

  1. - I put everything in one block and added sharedscripts, so that mysql gets 

#   flush-logs'd only once.

#   Else the binary logs would automatically increase by n times every day.

  1. - The error log is obsolete, messages go to syslog now.

/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log {

daily

rotate 7

missingok

create 640 mysql adm

compress

sharedscripts

postrotate

test -x /usr/bin/mysqladmin || exit 0

 

  1. If this fails, check debian.conf! 

MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"

if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then

  # Really no mysqld or rather a missing debian-sys-maint user?

  # If this occurs and is not a error please report a bug.

  if ps cax | grep -q mysqld; then

      exit 1

  fi 

else

  $MYADMIN flush-logs

fi

endscript

}

root@db4:/etc/logrotate.d# ls -l /etc/mysql/debian.cnf

 

ls: cannot access '/etc/mysql/debian.cnf': No such file or directory

Environment

fresh Xenial ubuntu

blocks

Smart Checklist

Activity

Show:

David Bennett January 27, 2020 at 2:59 PM

    it is also possible to flush the logs by sending the SIGHUP signal to the mysqld process.  However,  this has a side effect of  of also reloading the grant tables,  the thread cache, and the host cache.   This is not catastrophic but I am not sure we should enable this by default,  especially since upstream does not even ship logrotate configurations.    btw,  MariaDB does ship with a logrotate configuration (at least on fedora 30) and uses the SIGHUP method:

Evgeniy Patlan February 8, 2018 at 8:32 AM
Edited

thanks

Constantin Bogomolnyi February 6, 2018 at 8:46 PM

Hi

 

i'll try to reinstall a fresh 16.04 tomorrow but without it init script cannot properly restart the node

MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"

if [ -z "`$MYADMIN ping 2>/dev/null`" ]; then <- this does not work so it fail to work properly 

 

and also logrotation does not work too

 

regards

 

Evgeniy Patlan February 6, 2018 at 5:27 PM

Hi

Yes I know that it is missed but without it service starts and works correctly. COuld you please provide some logs about the issue what appears without it.

Constantin Bogomolnyi February 6, 2018 at 2:30 PM

Hello

just a clean ubuntu 16.04 and install via package 

debian.cnf is missing after this

 

regards

Done

Details

Assignee

Reporter

Time tracking

1d 6h logged

Components

Affects versions

Priority

Smart Checklist

Created January 30, 2018 at 1:29 PM
Updated March 6, 2024 at 10:35 PM
Resolved February 6, 2020 at 12:35 PM