[debian-mysql] Bug#830976: logrotate failures if mysql server is not running
Kevin Velghe
kevin at paretje.be
Fri Oct 21 13:26:15 UTC 2016
Package: mariadb-server-10.0
Version: 10.0.27-2
Followup-For: Bug #830976
Actually, I think this might be bug in grep. If I run `my_print_defaults
--mysqld`, I get:
--user=mysql
--pid-file=/var/run/mysqld/mysqld.pid
--socket=/var/run/mysqld/mysqld.sock
--port=3306
--basedir=/usr
--datadir=/var/lib/mysql
--tmpdir=/tmp
--lc-messages-dir=/usr/share/mysql
--skip-external-locking
--bind-address=127.0.0.1
--key_buffer_size=16M
--max_allowed_packet=16M
--thread_stack=192K
--thread_cache_size=8
--myisam-recover=BACKUP
--query_cache_limit=1M
--query_cache_size=16M
--log_error=/var/log/mysql/error.log
--expire_logs_days=10
--max_binlog_size=100M
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
But grep doesn't match. When we slightly change the grep command, it
does work:
my_print_defaults --mysqld | grep -Po "pid-file=\K.+$"
`my_print_defaults --mysqld | grep -Po "pid-file=\K[^$]+"` does match,
and strangely, so does `echo '--pid-file=/var/run/mysqld/mysqld.pid' |
grep -Po "pid-file=\K[^$]+"`, or `my_print_defaults --mysqld | grep -Po
"pid-file=\K[a-z/]+"`, or `my_print_defaults --mysqld | fgrep pid-file |
grep -Po "pid-file=\K[^$]+"`.
`my_print_defaults --mysqld | grep -Po "pid-file=\K[^?]+"` for instance
fails. Anyway, I guess I should report this as a bug against grep, or is
there something I've missed?
Included is a patch to use `.+$` instead of `.[^$]+`, which should fix
this issue for mariadb.
-- System Information:
Debian Release: stretch/sid
APT prefers testing
APT policy: (500, 'testing'), (200, 'stable'), (120, 'unstable'), (100, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 4.7.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages mariadb-server-10.0 depends on:
ii adduser 3.115
ii debconf [debconf-2.0] 1.5.59
ii libaio1 0.3.110-3
ii libc6 2.24-3
ii libdbi-perl 1.636-1+b1
ii libpam0g 1.1.8-3.3
ii libstdc++6 6.2.0-6
ii lsb-base 9.20160629
ii mariadb-client-10.0 10.0.27-2
ii mariadb-common 10.0.27-2
ii mariadb-server-core-10.0 10.0.27-2
ii passwd 1:4.2-3.2
ii perl 5.24.1~rc3-3
ii psmisc 22.21-2.1+b1
ii zlib1g 1:1.2.8.dfsg-2+b1
Versions of packages mariadb-server-10.0 recommends:
pn libhtml-template-perl <none>
Versions of packages mariadb-server-10.0 suggests:
ii bsd-mailx [mailx] 8.1.2-0.20160123cvs-3
pn mariadb-test <none>
pn tinyca <none>
-- debconf information excluded
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Circumvent-grep-issue-in-logrotate.patch
Type: text/x-diff
Size: 984 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20161021/532a7c5d/attachment.patch>
More information about the pkg-mysql-maint
mailing list