packages/lang/php7/files/php7-fastcgi.init
W. Michael Petullo a5d2ea9ed0 php7: facilitate running php7-fastcgi without listening on TCP socket
The init.d script for php7-fastcgi no longer invokes php7-fastcgi with
the '-b' flag when 'port' does not appear in /etc/config/php7-fastcgi.
This causes php7-fastcgi to communicate using only a Unix socket.

Signed-off-by: W. Michael Petullo <mike@flyn.org>
2019-04-13 08:25:34 -04:00

29 lines
469 B
Bash

#!/bin/sh /etc/rc.common
START=50
SERVICE_DAEMONIZE=1
SERVICE_WRITE_PID=1
start_instance() {
local section="$1"
local enabled
local port
config_get_bool enabled "$section" 'enabled' 0
config_get port "$section" 'port'
[ $enabled -gt 0 ] || return 1
PHP_FCGI_CHILDREN='' \
service_start /usr/bin/php-fcgi ${port:+-b $port}
}
start() {
config_load 'php7-fastcgi'
config_foreach start_instance 'php7-fastcgi'
}
stop() {
service_stop /usr/bin/php-fcgi
}