1 |
commit: 4b7d40cb0dd5213674766c48193efba1da74edff |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jan 22 17:22:26 2020 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jan 22 22:51:43 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/eselect-php.git/commit/?id=4b7d40cb |
7 |
|
8 |
src/php-fpm.logrotate.in: add a logrotate script for php-fpm. |
9 |
|
10 |
Since all of the log files for php-fpm wind up in the same place |
11 |
regardless of slot, we install a single logrotate file as part of |
12 |
eselect-php. The contents of the file may not be perfect -- they were |
13 |
taken from the example submitted on bug 692194 untested -- but will be |
14 |
easy to update in the future. |
15 |
|
16 |
Bug: https://bugs.gentoo.org/692194 |
17 |
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org> |
18 |
|
19 |
.gitignore | 1 + |
20 |
Makefile.am | 9 +++++++-- |
21 |
src/php-fpm.logrotate.in | 7 +++++++ |
22 |
3 files changed, 15 insertions(+), 2 deletions(-) |
23 |
|
24 |
diff --git a/.gitignore b/.gitignore |
25 |
index 9bfa566..420a5c3 100644 |
26 |
--- a/.gitignore |
27 |
+++ b/.gitignore |
28 |
@@ -12,3 +12,4 @@ openrc/init.d/php-fpm.in |
29 |
src/php.eselect |
30 |
src/php.eselect.in |
31 |
src/php-fpm-launcher |
32 |
+src/php-fpm.logrotate |
33 |
|
34 |
diff --git a/Makefile.am b/Makefile.am |
35 |
index f544739..e425c84 100644 |
36 |
--- a/Makefile.am |
37 |
+++ b/Makefile.am |
38 |
@@ -4,7 +4,8 @@ nodist_eselect_DATA = $(srcdir)/src/php.eselect |
39 |
# Without EXTRA_DIST, these files don't wind up in the tarball. |
40 |
EXTRA_DIST = $(srcdir)/openrc \ |
41 |
$(srcdir)/src/70_mod_php.conf.in \ |
42 |
- $(srcdir)/src/php-fpm-launcher.in |
43 |
+ $(srcdir)/src/php-fpm-launcher.in \ |
44 |
+ $(srcdir)/src/php-fpm.logrotate.in |
45 |
|
46 |
if APACHE2 |
47 |
# Without these set, we won't try to install the conf file. |
48 |
@@ -22,6 +23,9 @@ if FPM |
49 |
|
50 |
nodist_libexec_SCRIPTS = $(srcdir)/src/php-fpm-launcher |
51 |
|
52 |
+ logrotatedir = $(sysconfdir)/logrotate.d |
53 |
+ nodist_logrotate_DATA = $(srcdir)/src/php-fpm.logrotate |
54 |
+ |
55 |
tmpfilesdir = $(prefix)/lib/tmpfiles.d |
56 |
dist_tmpfiles_DATA = $(srcdir)/src/php-fpm.conf |
57 |
endif |
58 |
@@ -37,7 +41,7 @@ edit = sed -e 's|@BINDIR[@]|$(bindir)|g' \ |
59 |
-e 's|@SYSCONFDIR[@]|$(sysconfdir)|g' |
60 |
|
61 |
|
62 |
-$(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS) $(nodist_libexec_SCRIPTS): Makefile |
63 |
+$(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS) $(nodist_libexec_SCRIPTS) $(nodist_logrotate_DATA): Makefile |
64 |
rm -f $@ $@.tmp |
65 |
srcdir=''; \ |
66 |
test -f ./$@.in || srcdir=$(srcdir)/; \ |
67 |
@@ -46,5 +50,6 @@ $(nodist_eselect_DATA) $(nodist_apacheconf_DATA) $(nodist_init_SCRIPTS) $(nodist |
68 |
|
69 |
$(srcdir)/src/php.eselect: $(srcdir)/src/php.eselect.in |
70 |
$(srcdir)/src/php-fpm-launcher: $(srcdir)/src/php-fpm-launcher.in |
71 |
+$(srcdir)/src/php-fpm.logrotate: $(srcdir)/src/php-fpm.logrotate.in |
72 |
$(srcdir)/src/70_mod_php.conf: $(srcdir)/src/70_mod_php.conf.in |
73 |
$(srcdir)/openrc/init.d/php-fpm: $(srcdir)/openrc/init.d/php-fpm.in |
74 |
|
75 |
diff --git a/src/php-fpm.logrotate.in b/src/php-fpm.logrotate.in |
76 |
new file mode 100644 |
77 |
index 0000000..5847fdc |
78 |
--- /dev/null |
79 |
+++ b/src/php-fpm.logrotate.in |
80 |
@@ -0,0 +1,7 @@ |
81 |
+@LOCALSTATEDIR@/log/php-fpm.log @LOCALSTATEDIR@/log/php-fpm-*.log.slow { |
82 |
+ create 600 root root |
83 |
+ size 5M |
84 |
+ copytruncate |
85 |
+ notifempty |
86 |
+ missingok |
87 |
+} |