summaryrefslogtreecommitdiff
blob: 508fbe08d01388014848331ca84aec765ef5597e (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
#!/sbin/runscript

PHPSLOT=${SVCNAME#php-fpm-}

if [[ $PHPSLOT == "php-fpm" ]]; then
	PHPSLOT=$(eselect php show fpm)
else
	PHPSLOT=php${PHPSLOT}
fi


PHP_FPM_CONF="/etc/php/fpm-${PHPSLOT}/php-fpm.conf"


opts="depend start stop reload"

depend() {
        need net
				use apache2 lighttpd nginx
}

start() {
        ebegin "Starting PHP FastCGI server"
        start-stop-daemon --start --exec /usr/lib/${PHPSLOT}/bin/php-fpm -- -y "${PHP_FPM_CONF}"
        eend $?
}

stop() {
        ebegin "Stopping PHP FastCGI server"
        start-stop-daemon --stop --exec /usr/lib/${PHPSLOT}/bin/php-fpm
        eend $?
}