1
|
#!/bin/sh
|
2
|
#
|
3
|
# rc.php-fpm-restart
|
4
|
#
|
5
|
# part of pfSense (https://www.pfsense.org)
|
6
|
# Copyright (c) 2014-2016 Rubicon Communications, LLC (Netgate)
|
7
|
# All rights reserved.
|
8
|
#
|
9
|
# originally based on m0n0wall (http://neon1.net/m0n0wall)
|
10
|
# Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
11
|
# All rights reserved.
|
12
|
#
|
13
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
14
|
# you may not use this file except in compliance with the License.
|
15
|
# You may obtain a copy of the License at
|
16
|
#
|
17
|
# http://www.apache.org/licenses/LICENSE-2.0
|
18
|
#
|
19
|
# Unless required by applicable law or agreed to in writing, software
|
20
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
21
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
22
|
# See the License for the specific language governing permissions and
|
23
|
# limitations under the License.
|
24
|
|
25
|
echo ">>> Killing check_reload_status"
|
26
|
/bin/pkill -9 check_reload_status
|
27
|
sleep 2
|
28
|
|
29
|
echo ">>> Killing php-fpm"
|
30
|
/bin/pkill -F /var/run/php-fpm.pid
|
31
|
sleep 2
|
32
|
|
33
|
# Run the php.ini setup file and populate
|
34
|
# /usr/local/etc/php.ini
|
35
|
/etc/rc.php_ini_setup 2>/tmp/php_errors.txt
|
36
|
/bin/rm -f /var/run/php-fpm.pid 2>/dev/null
|
37
|
/bin/rm -f /var/run/php-fpm.socket 2>/dev/null
|
38
|
if [ -f /tmp/xmlrpc.lock ]; then
|
39
|
echo ">>> Found XMLRPC lock. Removing."
|
40
|
echo ">>> Found XMLRPC lock. Removing." | /usr/bin/logger -p daemon.info -i -t rc.php-fpm_restart
|
41
|
rm /tmp/xmlrpc.lock
|
42
|
fi
|
43
|
echo ">>> Restarting php-fpm" | /usr/bin/logger -p daemon.info -i -t rc.php-fpm_restart
|
44
|
echo ">>> Starting php-fpm"
|
45
|
/usr/local/sbin/php-fpm -c /usr/local/etc/php.ini -y /usr/local/lib/php-fpm.conf -RD 2>&1 >/dev/null
|
46
|
|
47
|
# restart check_reload_status
|
48
|
echo ">>> Starting check_reload_status"
|
49
|
/usr/bin/nice -n20 /usr/local/sbin/check_reload_status
|