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

Lennart Weller lhw at ring0.de
Fri Mar 4 12:41:00 UTC 2016


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.

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logrotate.patch
Type: application/octet-stream
Size: 970 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20160304/f5c21f0b/attachment.obj>


More information about the pkg-mysql-maint mailing list