Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 692194 - app-eselect/eselect-php: please consider adding logrotate for php-fpm
Summary: app-eselect/eselect-php: please consider adding logrotate for php-fpm
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-15 08:57 UTC by Tomáš Mózes
Modified: 2020-03-01 13:59 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 Tomáš Mózes 2019-08-15 08:57:27 UTC
We should consider at least /var/log/php-fpm.log and ideally /var/log/php-fpm-*.log.slow too.
Comment 1 Tomáš Mózes 2019-08-15 11:39:01 UTC
Maybe something like:

/var/log/php-fpm.log /var/log/php-fpm-*.log.slow {
        create 600 root root
        size 5M
        copytruncate
        notifempty
        missingok
}

It's possible to signal php-fpm, but since you can have multiple versions, it's maybe fine to just copy and truncate the logs.
Comment 2 Michael Orlitzky gentoo-dev 2020-01-22 14:03:53 UTC
The path to these logs doesn't change when you eselect different versions of php-fpm, right? I'm thinking this should go in dev-lang/php and not in eselect-php.

Likewise -- even though I probably put it there -- I'm also thinking the tmpfiles entry for php-fpm should get moved out of eselect-php and into dev-lang/php. Only things with a $SLOT in them (basically, custom Gentoo stuff) needs to be part of eselect-php.
Comment 3 Brian Evans (RETIRED) gentoo-dev 2020-01-22 14:15:41 UTC
(In reply to Michael Orlitzky from comment #2)
> The path to these logs doesn't change when you eselect different versions of
> php-fpm, right? I'm thinking this should go in dev-lang/php and not in
> eselect-php.
> 
> Likewise -- even though I probably put it there -- I'm also thinking the
> tmpfiles entry for php-fpm should get moved out of eselect-php and into
> dev-lang/php. Only things with a $SLOT in them (basically, custom Gentoo
> stuff) needs to be part of eselect-php.

I think you have this backwards a bit.  Files *common* to all slots must go in a separate package as well or there will be a file collision when multiple slots are installed.

If a single logrotate covers all slots, it needs to be in eselect-php (since that's where the common init files are too).

If there is to be a different logrotate for each slot, then yes, it belongs in dev-lang/php
Comment 4 Michael Orlitzky gentoo-dev 2020-01-22 14:27:51 UTC
(In reply to Brian Evans from comment #3)

> 
> I think you have this backwards a bit.  Files *common* to all slots must go
> in a separate package as well or there will be a file collision when
> multiple slots are installed.

See, that's why you're in charge now.

Tomas, presumably this has been working for you? If so I'll add it as-is to the git repo. Now's a good time to "upstream" the php-fpm-launcher script as well, and to figure out "eselect php embed" might look like.
Comment 5 Tomáš Mózes 2020-01-23 09:01:53 UTC
(In reply to Michael Orlitzky from comment #4)
> Tomas, presumably this has been working for you? 

Yes, we have this deployed on our php-fpm servers.
Comment 6 Larry the Git Cow gentoo-dev 2020-01-23 15:06:34 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=4b7d40cb0dd5213674766c48193efba1da74edff

commit 4b7d40cb0dd5213674766c48193efba1da74edff
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2020-01-22 17:22:26 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2020-01-22 22:51:43 +0000

    src/php-fpm.logrotate.in: add a logrotate script for php-fpm.
    
    Since all of the log files for php-fpm wind up in the same place
    regardless of slot, we install a single logrotate file as part of
    eselect-php. The contents of the file may not be perfect -- they were
    taken from the example submitted on bug 692194 untested -- but will be
    easy to update in the future.
    
    Bug: https://bugs.gentoo.org/692194
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 .gitignore               | 1 +
 Makefile.am              | 9 +++++++--
 src/php-fpm.logrotate.in | 7 +++++++
 3 files changed, 15 insertions(+), 2 deletions(-)
Comment 7 Michael Orlitzky gentoo-dev 2020-01-23 18:08:03 UTC
Ok, it's in eselect-php-9999 and will be a part of 0.9.6 when I hear back on bug 659592.
Comment 8 Tomáš Mózes 2020-01-23 19:12:06 UTC
Thanks
Comment 9 Larry the Git Cow gentoo-dev 2020-03-01 13:59:48 UTC
The bug has been closed via the following commit(s):

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

commit 80e9cccfa6bf0f6fc15dda9f1423d5cdca8b2354
Author:     Michael Orlitzky <mjo@gentoo.org>
AuthorDate: 2020-03-01 13:10:27 +0000
Commit:     Michael Orlitzky <mjo@gentoo.org>
CommitDate: 2020-03-01 13:58:34 +0000

    app-eselect/eselect-php: new version 0.9.6.
    
    New EAPI=7 version with some nice stuff:
    
      * The php-fpm-launcher script and php-fpm.conf tmpfiles.d entry
        are now upstream, simplifying the ebuild.
    
      * We install a logrotate script for php-fpm.
    
      * The eselect module itself now supports $ROOT.
    
      * We support symlinks for the "phar" executable.
    
    Closes: https://bugs.gentoo.org/692194
    Closes: https://bugs.gentoo.org/709422
    Closes: https://bugs.gentoo.org/707876
    Package-Manager: Portage-2.3.84, Repoman-2.3.20
    Signed-off-by: Michael Orlitzky <mjo@gentoo.org>

 app-eselect/eselect-php/Manifest                 |  1 +
 app-eselect/eselect-php/eselect-php-0.9.6.ebuild | 33 ++++++++++++++++++++++++
 2 files changed, 34 insertions(+)