1 |
a3cc8dcc
|
Ermal
|
#!/bin/sh
|
2 |
8acd654a
|
Renato Botelho
|
#
|
3 |
|
|
# rc.php-fpm-restart
|
4 |
|
|
#
|
5 |
|
|
# part of pfSense (https://www.pfsense.org)
|
6 |
2a2396a6
|
Renato Botelho
|
# Copyright (c) 2014-2016 Rubicon Communications, LLC (Netgate)
|
7 |
8acd654a
|
Renato Botelho
|
# All rights reserved.
|
8 |
|
|
#
|
9 |
|
|
# originally based on m0n0wall (http://neon1.net/m0n0wall)
|
10 |
aaec5634
|
Renato Botelho
|
# Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
|
11 |
8acd654a
|
Renato Botelho
|
# 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 |
a3cc8dcc
|
Ermal
|
|
57 |
9a25a85d
|
Chris Buechler
|
echo ">>> Killing php-fpm"
|
58 |
e173dd74
|
Phil Davis
|
/bin/pkill -F /var/run/php-fpm.pid
|
59 |
a3cc8dcc
|
Ermal
|
sleep 2
|
60 |
|
|
|
61 |
|
|
# Run the php.ini setup file and populate
|
62 |
3646fbcb
|
Renato Botelho
|
# /usr/local/etc/php.ini
|
63 |
1d8c79cc
|
Phil Davis
|
/etc/rc.conf_mount_rw
|
64 |
a3cc8dcc
|
Ermal
|
/etc/rc.php_ini_setup 2>/tmp/php_errors.txt
|
65 |
e5a67d33
|
jim-p
|
/bin/rm -f /var/run/php-fpm.pid 2>/dev/null
|
66 |
|
|
/bin/rm -f /var/run/php-fpm.socket 2>/dev/null
|
67 |
8ad194c0
|
Chris Buechler
|
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 |
2d375e81
|
Phil Davis
|
/etc/rc.conf_mount_ro
|
73 |
a3cc8dcc
|
Ermal
|
echo ">>> Restarting php-fpm" | /usr/bin/logger -p daemon.info -i -t rc.php-fpm_restart
|
74 |
9a25a85d
|
Chris Buechler
|
echo ">>> Starting php-fpm"
|
75 |
3646fbcb
|
Renato Botelho
|
/usr/local/sbin/php-fpm -c /usr/local/etc/php.ini -y /usr/local/lib/php-fpm.conf -RD 2>&1 >/dev/null
|