aboutsummaryrefslogtreecommitdiffstats
path: root/testing/php7/php7-fpm.initd
blob: 1016c68f0dd0be300935195010d4c6f422fa5338 (plain)
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
#!/sbin/openrc-run

name="PHP7 FastCGI Process Manager"
cfgfile="/etc/php7/php-fpm.conf"
pidfile="/var/run/php-fpm7.pid"
command="/usr/sbin/php-fpm7"
command_args="--fpm-config $cfgfile --pid $pidfile"
required_files="$cfgfile"

extra_started_commands="reload reopen"
description_reload="Reload configuration"
description_reopen="Reopen log files"

depend() {
	need net
	before apache2 lighttpd nginx
}

start_pre() {
	ebegin
	$command $command_args -t 2>/dev/null
	eend $?
}

reload() {
	ebegin "Reloading ${SVCNAME} configuration"
	start-stop-daemon --signal USR2 --pidfile $pidfile
	eend $?
}

reopen() {
	ebegin Reopening ${SVCNAME} log files""
	start-stop-daemon --signal USR1 --pidfile $pidfile
	eend $?
}