Skip to content

Commit

Permalink
Adding the option to set process.dumpable
Browse files Browse the repository at this point in the history
  • Loading branch information
mhagstrand committed Mar 19, 2019
1 parent 64bbc0b commit d8759ee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions manifests/fpm/pool.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
# [*template*]
# The template to use for the pool
#
# [*process.dumpable*]
# Allow PHP to create a coredump during a segfault. Must still set
# rlimit_core
#
# [*rlimit_files*]
#
# [*rlimit_core*]
Expand Down Expand Up @@ -144,6 +148,7 @@
$security_limit_extensions = undef,
$slowlog = "/var/log/php-fpm/${name}-slow.log",
$template = 'php/fpm/pool.conf.erb',
$process_dumpable = false,
$rlimit_files = undef,
$rlimit_core = undef,
$chroot = undef,
Expand All @@ -168,6 +173,12 @@
warning('You must include the php base class before using any php defined resources')
}

if ($php::globals::php_version != undef) {
$php_version_major = regsubst($php::globals::php_version, '^(\d+)\.(\d+)$','\1')
} else {
$php_version_major = 5
}

$pool = $title

# Hack-ish to default to user for group too
Expand Down
12 changes: 12 additions & 0 deletions templates/fpm/pool.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@ group = <%= @group_final %>
; Note: This value is mandatory.
pm = <%= @pm %>
<% if @php_version_major.to_i >= 7 -%>
; Set the process dumpable flag (PR_SET_DUMPABLE prctl) even if the process user
; or group is differrent than the master process user. It allows to create process
; core dump and ptrace the process for the pool user.
; Default Value: no
<% if @process_dumpable -%>
process.dumpable = yes
<% else -%>
process.dumpable = no
<% end -%>
<% end -%>

; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes to be created when pm is set to 'dynamic'.
; This value sets the limit on the number of simultaneous requests that will be
Expand Down

0 comments on commit d8759ee

Please sign in to comment.