[debian-mysql] Bug#810968: Fwd: Bug#810968: Bug#810968: mariadb-server-10.0: Logrotate exists 1 if a non-debian mysqld is running (e.g. containerized mysqld)

Sergey Vojtovich svoj at mariadb.org
Mon Mar 7 12:15:54 UTC 2016


Hi Lennart,

First, thanks for reporting this problem back to us and for suggested fix.

> March 3 2016 9:35 PM, "Otto Kekäläinen" <otto at seravo.fi> wrote:
> > Hello Lennart!
> >
> > I asked core developers to review this and got this reply:
> >
> > It's probably alright for 10.0. But it's not completely suitable for 10.1.
> > As contributor mentioned himself that there's a problem with this patch:
> > "When mysqld is called without mysqld_safe".
> >
> > I'd rather simplify this script to something like (not tested):
> > if [ -x /var/run/mysqld/mysqld.pid ]; then
> > $MYADMIN flush-logs || exit 1
> > fi
> >
> > What do you think?
> 
> The line would result in some other issues. But the general idea was
> already tossed around
> here before. Assume pid file location and then check if the process
> running on the pid
> is named mysqld.
> 
> I don't really see an issue with my current version either though. In
> case that the mysqld_safe script
> will be abandoned in the future a lot of the configuration files and
> init scripts/unit files
> need to be updated anyhow. And the only change here would be removing
> one layer in the hierachy.
In MariaDB 10.1 we introduced optional support for systemd. That is parent
process can be either systemd or mysqld_safe. Also I'm reluctant having
different versions of logrotate script in 10.0 and 10.1.

> 
> From:
> PPID=$(ps -o ppid= -p $PID)
> if [ $(ps -p $PPID -o comm=) = mysqld_safe ]; then
>   test $(ps -o ppid= -p  $PPID) -eq 1 && exit 1
> fi
> 
> To:
> test $(ps -o ppid= -p $PID) -eq 1 && exit 1
> 
> But if you are fine with just checking the PID file at a static
> location something like the attached patch should be fine.
I consider it lesser evil. You may use my_print_defaults to get
pid-file value.

Worth to note that I don't see any value in executing "mysqladmin ping".

Regards,
Sergey



More information about the pkg-mysql-maint mailing list