Gentoo Archives: gentoo-commits

From: "Ulrich Mueller (ulm)" <ulm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-eselect/eselect-php/files: php-fpm.init php-fpm-r1.init php-fpm-launcher php-fpm_at.service php-fpm.conf 70_mod_php5.conf-apache2
Date: Tue, 31 Mar 2015 16:53:57
Message-Id: 20150331165351.1DF2614EE1@oystercatcher.gentoo.org
1 ulm 15/03/31 16:53:51
2
3 Added: php-fpm.init php-fpm-r1.init php-fpm-launcher
4 php-fpm_at.service php-fpm.conf
5 70_mod_php5.conf-apache2
6 Log:
7 Move package from app-admin to app-eselect category.
8
9 (Portage version: 2.2.18/cvs/Linux x86_64, RepoMan options: --force, signed Manifest commit with key 9433907D693FB5B8!)
10
11 Revision Changes Path
12 1.1 app-eselect/eselect-php/files/php-fpm.init
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm.init?rev=1.1&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm.init?rev=1.1&content-type=text/plain
16
17 Index: php-fpm.init
18 ===================================================================
19 #!/sbin/runscript
20
21 set_phpvars() {
22 PHPSLOT=${SVCNAME#php-fpm-}
23 [ ${PHPSLOT} = 'php-fpm' ] && PHPSLOT="$(eselect php show fpm)"
24
25 PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"
26 PHP_FPM_PID="/var/run/php-fpm-${PHPSLOT}.pid"
27 }
28
29 extra_commands="depend"
30 extra_started_commands="reload"
31
32 depend() {
33 need net
34 use apache2 lighttpd nginx
35 }
36
37 start() {
38 ebegin "Starting PHP FastCGI Process Manager"
39 set_phpvars
40 start-stop-daemon --start --pidfile ${PHP_FPM_PID} --exec \
41 /usr/lib/${PHPSLOT}/bin/php-fpm -- -y "${PHP_FPM_CONF}" -g "${PHP_FPM_PID}"
42 local i=0
43 local timeout=5
44 while [ ! -f ${PHP_FPM_PID} ] && [ $i -le $timeout ]; do
45 sleep 1
46 i=$(($i + 1))
47 done
48
49 [ $timeout -gt $i ]
50 eend $?
51 }
52
53 stop() {
54 ebegin "Stopping PHP FastCGI Process Manager"
55 set_phpvars
56 start-stop-daemon --signal QUIT --stop --exec /usr/lib/${PHPSLOT}/bin/php-fpm --pidfile ${PHP_FPM_PID}
57 eend $?
58 }
59
60 reload() {
61 ebegin "Reloading PHP FastCGI Process Manager"
62 set_phpvars
63 [ -f ${PHP_FPM_PID} ] && kill -USR2 $(cat ${PHP_FPM_PID})
64 eend $?
65 }
66
67
68
69 1.1 app-eselect/eselect-php/files/php-fpm-r1.init
70
71 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm-r1.init?rev=1.1&view=markup
72 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm-r1.init?rev=1.1&content-type=text/plain
73
74 Index: php-fpm-r1.init
75 ===================================================================
76 #!/sbin/runscript
77
78 set_phpvars() {
79 PHPSLOT=${SVCNAME#php-fpm-}
80 PHP_FPM_PID="/run/php-fpm-${PHPSLOT}.pid"
81 if [ ${PHPSLOT} = 'php-fpm' ] ; then
82 PHPSLOT="$(eselect php show fpm)"
83 PHP_FPM_PID="/run/php-fpm.pid"
84 fi
85
86 PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"
87 }
88
89 extra_commands="depend"
90 extra_started_commands="reload"
91
92 depend() {
93 need net
94 use apache2 lighttpd nginx
95 }
96
97 start() {
98 ebegin "Starting PHP FastCGI Process Manager"
99 set_phpvars
100 start-stop-daemon --start --pidfile ${PHP_FPM_PID} --exec \
101 /usr/lib/${PHPSLOT}/bin/php-fpm -- -y "${PHP_FPM_CONF}" -g "${PHP_FPM_PID}"
102 local i=0
103 local timeout=5
104 while [ ! -f ${PHP_FPM_PID} ] && [ $i -le $timeout ]; do
105 sleep 1
106 i=$(($i + 1))
107 done
108
109 [ $timeout -gt $i ]
110 eend $?
111 }
112
113 stop() {
114 ebegin "Stopping PHP FastCGI Process Manager"
115 set_phpvars
116 start-stop-daemon --signal QUIT --stop --exec /usr/lib/${PHPSLOT}/bin/php-fpm --pidfile ${PHP_FPM_PID}
117 eend $?
118 }
119
120 reload() {
121 ebegin "Reloading PHP FastCGI Process Manager"
122 set_phpvars
123 [ -f ${PHP_FPM_PID} ] && kill -USR2 $(cat ${PHP_FPM_PID})
124 eend $?
125 }
126
127
128
129 1.1 app-eselect/eselect-php/files/php-fpm-launcher
130
131 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm-launcher?rev=1.1&view=markup
132 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm-launcher?rev=1.1&content-type=text/plain
133
134 Index: php-fpm-launcher
135 ===================================================================
136 #!/bin/sh
137
138 PHPSLOT="${1}"
139 [ -z "${PHPSLOT}" ] && PHPSLOT="$(eselect php show fpm)"
140 shift
141
142 exec /usr/lib/${PHPSLOT}/bin/php-fpm "${@}"
143
144
145
146 1.1 app-eselect/eselect-php/files/php-fpm_at.service
147
148 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm_at.service?rev=1.1&view=markup
149 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm_at.service?rev=1.1&content-type=text/plain
150
151 Index: php-fpm_at.service
152 ===================================================================
153 [Unit]
154 Description=The PHP FastCGI Process Manager
155 After=network.target
156
157 [Service]
158 Type=notify
159 PIDFile=/run/php-fpm/php-fpm-%I.pid
160 ExecStart=/usr/libexec/php-fpm-launcher php%I -y /etc/php/fpm-php%I/php-fpm.conf --nodaemonize
161 ExecReload=/bin/kill -USR2 $MAINPID
162 PrivateTmp=true
163
164 [Install]
165 WantedBy=multi-user.target
166
167
168
169
170 1.1 app-eselect/eselect-php/files/php-fpm.conf
171
172 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm.conf?rev=1.1&view=markup
173 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/php-fpm.conf?rev=1.1&content-type=text/plain
174
175 Index: php-fpm.conf
176 ===================================================================
177 d /run/php-fpm 755 root root
178
179
180
181 1.1 app-eselect/eselect-php/files/70_mod_php5.conf-apache2
182
183 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/70_mod_php5.conf-apache2?rev=1.1&view=markup
184 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-eselect/eselect-php/files/70_mod_php5.conf-apache2?rev=1.1&content-type=text/plain
185
186 Index: 70_mod_php5.conf-apache2
187 ===================================================================
188 <IfDefine PHP5>
189 # Load the module first
190 <IfModule !mod_php5.c>
191 LoadModule php5_module modules/libphp5.so
192 </IfModule>
193
194 # Set it to handle the files
195 <IfModule mod_mime.c>
196 AddHandler application/x-httpd-php .php .php5 .phtml
197 AddHandler application/x-httpd-php-source .phps
198 </IfModule>
199
200 DirectoryIndex index.php index.phtml
201 </IfDefine>