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
>From ecdcbd217462ef657a622eed27e38e40694969c6 Mon Sep 17 00:00:00 2001 From: Kevin Velghe <ke...@paretje.be> Date: Fri, 21 Oct 2016 15:21:18 +0200 Subject: [PATCH] Circumvent grep issue in logrotate --- debian/mariadb-server-10.0.mysql-server.logrotate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/mariadb-server-10.0.mysql-server.logrotate b/debian/mariadb-server-10.0.mysql-server.logrotate index 2a9c3cd..ccdcfc0 100644 --- a/debian/mariadb-server-10.0.mysql-server.logrotate +++ b/debian/mariadb-server-10.0.mysql-server.logrotate @@ -11,7 +11,7 @@ sharedscripts postrotate test -x /usr/bin/mysqladmin || exit 0 - if [ -f `my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"` ]; then + if [ -f "$(my_print_defaults --mysqld | grep -oP "pid-file=\K.+$")" ]; then # If this fails, check debian.conf! mysqladmin --defaults-file=/etc/mysql/debian.cnf flush-logs fi -- 2.9.3