Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahogony
php
Commits
a6dc0c9e
Commit
a6dc0c9e
authored
Oct 16, 2018
by
mh
Browse files
add a timer to kill childrens not serving a request
parent
8adf8a32
Changes
5
Hide whitespace changes
Inline
Side-by-side
files/fpm/kill-pool.service
0 → 100644
View file @
a6dc0c9e
[Unit]
Description
=
Kill fpm pools not serving requests
[Service]
ExecStart
=
/usr/local/sbin/fpm-kill-pool.sh
[Install]
WantedBy
=
default.target
files/fpm/kill-pool.sh
0 → 100644
View file @
a6dc0c9e
#!/bin/bash
shopt
-s
nullglob
for
fpm
in
/run/fpm-
*
/pid
;
do
CHILDREN
=
$(
ps
-o
pid
--no-headers
--ppid
`
cat
${
fpm
}
`
|
wc
-l
)
if
[
"
${
CHILDREN
}
"
==
"0"
]
;
then
kill
`
cat
${
fpm
}
`
fi
done
manifests/fpm.pp
View file @
a6dc0c9e
...
...
@@ -43,6 +43,7 @@ define php::fpm(
}
~>
Exec
[
'systemctl-daemon-reload'
]
if
$ensure
==
'present'
{
include
::php::fpm::base
File
[
"
${etcdir}
/php-fpm.d/
${name}
.conf"
]{
group
=>
$run_group
,
}
...
...
manifests/fpm/base.pp
0 → 100644
View file @
a6dc0c9e
# fpm base stuff
class
php::fpm::base
{
file
{
'/usr/local/sbin/fpm-kill-pool.sh'
:
source
=>
'puppet:///modules/php/fpm/kill-pool.sh'
,
owner
=>
root
,
group
=>
0
,
mode
=>
'0755'
,
}
->
systemd::unit_file
{
'fpm-kill-pool.service'
:
source
=>
'puppet:///modules/php/fpm/kill-pool.service'
,
}
->
systemd::unit_file
{
'fpm-kill-pool.timer'
:
content
=>
content
(
'php/fpm/fpm-kill-pool.timer.erb'
),
}
~>
service
{
'fpm-kill-pool.timer'
:
ensure
=>
running
,
enable
=>
true
,
}
}
templates/fpm/fpm-kill-pool.timer.erb
0 → 100644
View file @
a6dc0c9e
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment