Bug 773077 - php-fpm: buggy(?) logrotate config
php-fpm: buggy(?) logrotate config
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: php (Show other bugs)
16
All Linux
unspecified Severity medium
: ---
: ---
Assigned To: Remi Collet
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-10 15:55 EST by Anton Arapov
Modified: 2014-06-18 04:03 EDT (History)
5 users (show)

See Also:
Fixed In Version: php-5.3.9-1.fc16
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-01-19 17:00:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Anton Arapov 2012-01-10 15:55:50 EST
Description of problem:
logrotate doesn't rotate php-fpm log after clear install of f16

Version-Release number of selected component (if applicable):
# rpm -q php-fpm
php-fpm-5.3.8-3.fc16.x86_64

How reproducible:
- default configuration of logrotate, iow nothing has been touched.

# logrotate -d /etc/logrotate.conf /etc/logrotate.d/php-fpm 

Actual results:

rotating pattern: /var/log/php-fpm/*log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/php-fpm/error.log
error: skipping "/var/log/php-fpm/error.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /var/log/php-fpm/www-error.log
error: skipping "/var/log/php-fpm/www-error.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
not running postrotate script, since no logs were rotated

Expected results:
rotating pattern: /var/log/php-fpm/*log  weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/php-fpm/error.log
  log needs rotating
considering log /var/log/php-fpm/www-error.log
  log needs rotating
rotating log /var/log/php-fpm/error.log, log->rotateCount is 4
dateext suffix '-20120110'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
rotating log /var/log/php-fpm/www-error.log, log->rotateCount is 4
dateext suffix '-20120110'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
glob finding old rotated logs failed
fscreate context set to system_u:object_r:var_log_t:s0
renaming /var/log/php-fpm/error.log to /var/log/php-fpm/error.log-20120110
creating new /var/log/php-fpm/error.log mode = 0600 uid = 0 gid = 0
fscreate context set to system_u:object_r:var_log_t:s0
renaming /var/log/php-fpm/www-error.log to /var/log/php-fpm/www-error.log-20120110
creating new /var/log/php-fpm/www-error.log mode = 0644 uid = 48 gid = 48
running postrotate script
running script with arg /var/log/php-fpm/*log : "
	/bin/kill -SIGUSR1 `cat /var/run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
"
Comment 1 Anton Arapov 2012-01-10 15:57:11 EST
Fix for this is to add 'su' directive to the php-fpm config of logrotate.d

i.e.

/var/log/php-fpm/*log {
    su
    missingok
    notifempty
    sharedscripts
    delaycompress
    postrotate
        /bin/kill -SIGUSR1 `cat /var/run/php-fpm/php-fpm.pid 2>/dev/null` 2>/dev/null || true
    endscript
}

but I don't know whether this is the way to go...
Comment 2 David Nalley 2012-01-11 09:46:59 EST
Anton, 

This looks like it's assigned to the wrong component. (it's currently assigned to php-fpdf - which has nothing to do with what php-fpm does. Reassigning to php
Comment 3 Remi Collet 2012-01-11 11:32:43 EST
I will change owner to root on next update (php 5.3.9)
Comment 4 Fedora Update System 2012-01-11 15:00:17 EST
php-5.3.9-1.fc16,maniadrive-1.2-32.fc16.1,php-eaccelerator-0.9.6.1-9.fc16.1 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/php-5.3.9-1.fc16,maniadrive-1.2-32.fc16.1,php-eaccelerator-0.9.6.1-9.fc16.1
Comment 5 Fedora Update System 2012-01-15 15:07:15 EST
Package php-5.3.9-1.fc16, maniadrive-1.2-32.fc16.1, php-eaccelerator-0.9.6.1-9.fc16.1:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing php-5.3.9-1.fc16 maniadrive-1.2-32.fc16.1 php-eaccelerator-0.9.6.1-9.fc16.1'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-0504/php-5.3.9-1.fc16,maniadrive-1.2-32.fc16.1,php-eaccelerator-0.9.6.1-9.fc16.1
then log in and leave karma (feedback).
Comment 6 Fedora Update System 2012-01-19 17:00:02 EST
php-5.3.9-1.fc16, maniadrive-1.2-32.fc16.1, php-eaccelerator-0.9.6.1-9.fc16.1 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.