aboutsummaryrefslogtreecommitdiff
path: root/lang/php70/files/php-fpm.in
blob: 55e2ac99240873fd3dd71dcee3e49dae8e10809e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: php-fpm
# REQUIRE: LOGIN
# KEYWORD: shutdown

#
# Add the following line to /etc/rc.conf to enable php-fpm:
# php_fpm_enable="YES"
#

. /etc/rc.subr

name="php_fpm"
rcvar=php_fpm_enable

load_rc_config "$name"

: ${php_fpm_enable="NO"}

extra_commands="reload logrotate"

command="%%PREFIX%%/sbin/php-fpm"
pidfile="/var/run/php-fpm.pid"
sig_stop="QUIT"
sig_reload="USR2"
logrotate_cmd="php_fpm_logrotate"

required_files="%%PREFIX%%/etc/php-fpm.conf"

php_fpm_logrotate() {
        if [ -z "$rc_pid" ]; then
                _run_rc_notrunning
                return 1
        fi
        echo "Rotating logs $name."
        kill -USR1 $rc_pid
}

run_rc_command "$1"