Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow a custom location for the php-fpm error log #427

Closed
wants to merge 1 commit into from
Closed

Allow a custom location for the php-fpm error log #427

wants to merge 1 commit into from

Conversation

DJMuggs
Copy link

@DJMuggs DJMuggs commented Mar 12, 2018

I like the possibility to choose a custom error log location, very usefull if you use something like RHSCL in combination with this module.

Copy link
Member

@c33s c33s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error log config

the option to configure the fpm error log can be quite handy, as far as i can see the changes should be backwards compatible. looks nice to me

remove of the default fpm pool

from my experience with php-fpm i can say that the remove of the default pool leads to problems. without any pool the fpm service is not starting at all. this can be the case if puppet install and starts php-fpm first and adds the custom pools in a later run.

additional removing the default pool is a BC break. it can break existing installations which use this module. so this PR can only be introduced in a major version.
if parameters are removed, the old one should be mapped to the new one and marked deprecated. so there is no bc break and the user of the module gets a deprecation warning.

you can easily control your configs by inlcuding this module like this:

  class { '::php':
    fpm_pools => {},
  }

or with hiera:

your-manifest.pp

  class { '::php': }

common.yaml

php::fpm_pools: {}

general

the PR would be much easier to review if styling of existing code is applied in the last step. so many lines are "touched" without a real code change.

all in all i would vote to reject this PR because of the BC break with no real benefits.

@@ -15,6 +15,7 @@
Optional[Pattern[/^[57].[0-9]/]] $php_version = undef,
Optional[Stdlib::Absolutepath] $config_root = undef,
Optional[Stdlib::Absolutepath] $fpm_pid_file = undef,
Optional[Stdlib::Absolutepath] $fpm_error_log = undef,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syslog must be a valid option here

Copy link
Author

@DJMuggs DJMuggs Mar 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syslog is a valid option, see the $default_fpm_error_log in the Archlinux block.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your reply about the fpm pools, this has helped.

But i still need to handle the different location of the error log file when using an RHSCL php version.
I know there is already a PR for including RHSCL in php module, but that is taking already a while to get merged.

Will fix the coding style.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not sure about the Stdlib::Absolutepath will work for syslog as far as i can remember, the absolute path must start with a / see

if i set php::globals::fpm_error_log: syslog in my common.yaml in hiera, i will get an error. so it should be Optional or Optional[Enum['syslog'], Stdlib::Absolutepath] or something like that (the correct value has to be tested).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will take a look at this

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you reverted the pool change, please rename this PR removed default www fpm pool and added parameter for error log file -> added parameter for error log file

@bastelfreak
Copy link
Member

Hi @DJMuggs, thanks for the PR!
Can you squash the commits down a bit? 8 seems to be quite a few for such a change. Can you check the used email address in the commits? It isn't associated with your github account. Also take a look at the spec test, a few are failing.

@bastelfreak bastelfreak added needs-work not ready to merge just yet tests-fail labels Mar 14, 2018
@DJMuggs DJMuggs changed the title removed default www fpm pool and added parameter for error log file Allow a custom location for the error log Mar 14, 2018
@DJMuggs DJMuggs changed the title Allow a custom location for the error log Allow a custom location for the php-fpm error log Mar 14, 2018
@DJMuggs
Copy link
Author

DJMuggs commented Mar 14, 2018

Will squash the commits pretty soon

use String instead of Stdlib::Absolutepath for fpm_error_log to allow use of syslog
@DJMuggs
Copy link
Author

DJMuggs commented Apr 3, 2018

Your test fail because of the manage_repos => true for step 9 in your build ci process.
When you set manage_repos => false , the test for step 9 succeeds, but step 6,7,8 fail.

It has to do with a libdb5.1 that can't be found when using wheezy repos on jessie.

he following packages have unmet dependencies:
php5-cli : Depends: libdb5.1 but it is not installable
Recommends: php5-readline but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Error: /Stage[main]/Php::Packages/Package[php5-cli]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install php5-cli' returned 100: Reading package lists...

Can you please fix?

After this my pull request should be without errors.

@c33s
Copy link
Member

c33s commented Apr 4, 2018

@DJMuggs thank you for your debuging information. i am working on this issue #433 i came to the same result as you but i haven't made a fix yet. waiting for input on how we should resolve this.

@attachmentgenie
Copy link
Member

any progress on this ticket, i am using the php packages from remi and run into this problem too

@c33s
Copy link
Member

c33s commented Apr 13, 2018

@attachmentgenie see my comment above

@DJMuggs DJMuggs closed this Sep 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-work not ready to merge just yet tests-fail
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants