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
|
# Redistribution and use in source and binary forms, with or without
|
14
|
# modification, are permitted provided that the following conditions are met:
|
15
|
#
|
16
|
# 1. Redistributions of source code must retain the above copyright notice,
|
17
|
# this list of conditions and the following disclaimer.
|
18
|
#
|
19
|
# 2. Redistributions in binary form must reproduce the above copyright
|
20
|
# notice, this list of conditions and the following disclaimer in
|
21
|
# the documentation and/or other materials provided with the
|
22
|
# distribution.
|
23
|
#
|
24
|
# 3. All advertising materials mentioning features or use of this software
|
25
|
# must display the following acknowledgment:
|
26
|
# "This product includes software developed by the pfSense Project
|
27
|
# for use in the pfSense® software distribution. (http://www.pfsense.org/).
|
28
|
#
|
29
|
# 4. The names "pfSense" and "pfSense Project" must not be used to
|
30
|
# endorse or promote products derived from this software without
|
31
|
# prior written permission. For written permission, please contact
|
32
|
# coreteam@pfsense.org.
|
33
|
#
|
34
|
# 5. Products derived from this software may not be called "pfSense"
|
35
|
# nor may "pfSense" appear in their names without prior written
|
36
|
# permission of the Electric Sheep Fencing, LLC.
|
37
|
#
|
38
|
# 6. Redistributions of any form whatsoever must retain the following
|
39
|
# acknowledgment:
|
40
|
#
|
41
|
# "This product includes software developed by the pfSense Project
|
42
|
# for use in the pfSense software distribution (http://www.pfsense.org/).
|
43
|
#
|
44
|
# THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
|
45
|
# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
46
|
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
47
|
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
|
48
|
# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
49
|
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
50
|
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
51
|
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
52
|
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
53
|
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
54
|
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
55
|
# OF THE POSSIBILITY OF SUCH DAMAGE.
|
56
|
|
57
|
echo ">>> Killing php-fpm"
|
58
|
/bin/pkill -F /var/run/php-fpm.pid
|
59
|
sleep 2
|
60
|
|
61
|
# Run the php.ini setup file and populate
|
62
|
# /usr/local/etc/php.ini
|
63
|
/etc/rc.conf_mount_rw
|
64
|
/etc/rc.php_ini_setup 2>/tmp/php_errors.txt
|
65
|
/bin/rm -f /var/run/php-fpm.pid 2>/dev/null
|
66
|
/bin/rm -f /var/run/php-fpm.socket 2>/dev/null
|
67
|
if [ -f /tmp/xmlrpc.lock ]; then
|
68
|
echo ">>> Found XMLRPC lock. Removing."
|
69
|
echo ">>> Found XMLRPC lock. Removing." | /usr/bin/logger -p daemon.info -i -t rc.php-fpm_restart
|
70
|
rm /tmp/xmlrpc.lock
|
71
|
fi
|
72
|
/etc/rc.conf_mount_ro
|
73
|
echo ">>> Restarting php-fpm" | /usr/bin/logger -p daemon.info -i -t rc.php-fpm_restart
|
74
|
echo ">>> Starting php-fpm"
|
75
|
/usr/local/sbin/php-fpm -c /usr/local/etc/php.ini -y /usr/local/lib/php-fpm.conf -RD 2>&1 >/dev/null
|
76
|
|