Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 686378 - dev-db/mysql-init-scripts: lograte fails if pid-file is defined multiple times
Summary: dev-db/mysql-init-scripts: lograte fails if pid-file is defined multiple times
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-20 09:35 UTC by Steven Dürl
Modified: 2019-08-28 14:43 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Dürl 2019-05-20 09:35:17 UTC
The same bug as in https://bugs.gentoo.org/685822 also applies to /etc/logrotate.d/mysql.

Since we overwrite pid-file = /var/run/mysqld/mariadb.pid, the postrotate part of logrotate will fail with:

  cat: /var/run/mysqld/mariadb.pid: No such file or directory

Solution would be to add "| tail -n1" to postrotate:

  /bin/kill -HUP $(cat $(my_print_defaults server mysqld mariadb | grep 'pid[_-]file' | cut -d = -f 2 | tail -n1))

Another suggestion would be to move the whole SIGHUP part to /etc/init.d/mysql and just call "/etc/init.d/mysql rotate" within the postrotate.
Comment 1 Larry the Git Cow gentoo-dev 2019-08-28 14:43:33 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cda4995e825424bf017dc4a76e249d0531f841d4

commit cda4995e825424bf017dc4a76e249d0531f841d4
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2019-08-28 14:17:49 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-08-28 14:43:21 +0000

    dev-db/mysql-init-scripts: rev bump
    
    - Move acct-* dependencies to RDEPEND to support binary packages.
      Note: According to devmanual there will be a problem once emerge
            will merge RDEPEND after the actual package.
    
    - Handle the case when option is defined multiple times.
    
    Closes: https://bugs.gentoo.org/693000
    Closes: https://bugs.gentoo.org/686378
    Package-Manager: Portage-2.3.72, Repoman-2.3.17
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 .../mysql-init-scripts/files/logrotate.mysql-2.3   |  5 +-
 .../mysql-init-scripts-2.3-r3.ebuild               | 70 ++++++++++++++++++++++
 2 files changed, 74 insertions(+), 1 deletion(-)