php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69509 fpm slowlog file permissions feature
Submitted: 2015-04-23 06:29 UTC Modified: -
Votes:12
Avg. Score:4.2 ± 0.7
Reproduced:10 of 11 (90.9%)
Same Version:1 (10.0%)
Same OS:4 (40.0%)
From: chenmingjie0828 at 163 dot com Assigned:
Status: Open Package: FPM related
PHP Version: 5.6.8 OS: Centos6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-04-23 06:29 UTC] chenmingjie0828 at 163 dot com
Description:
------------
php-fpm generate log files with a default permission 0600,which makes other user or group unable to read the slow log or access log. So I make a patch to fixed this problem , which allows users to configure the file permission as they wanted. The entry in fpm configuration is file_mode directive.

fpm configruation:
slowlog = log/$pool.log.slow
request_slowlog_timeout = 5
request_terminate_timeout = 10

New feature:
   file_mode = 0644 //or other file permission u want.



Test script:
---------------
<?php
sleep(10);
echo "hello world";
?>


Expected result:
----------------
I expect fpm generate a slow log with file permission that other people are able to read.

Actual result:
--------------
ls -la www-slow_log 
-rw------- 1 root root 0 Apr 23 02:03 www.log.slow 

Actually, It generate a slow log with file permission 0666(-rw- --- ---),which makes other people unable to read. It's quite inconvenient, since I want some other development people to read it. 

Patches

filemode.patch (last revision 2015-04-23 06:29 UTC by chenmingjie0828 at 163 dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-02 16:54 UTC] mgarrido at archipelia dot com
This feature is very helpful.
I want to push php-fpm logs to my logstash.
But, my logstash daemon isn't root.
So, he can't read php-fpm logs.
With can't chmod manually because logrotate reset rights after his execution.
 [2016-11-07 09:23 UTC] pim at lemonbit dot com
Please make the file permissions on the slow log the same as the error log (same as process owner and group).
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 02:01:24 2019 UTC