1
0

php7-fastcgi.init 465 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh /etc/rc.common
  2. START=50
  3. SERVICE_DAEMONIZE=1
  4. SERVICE_WRITE_PID=1
  5. start_instance() {
  6. local section="$1"
  7. local enabled
  8. local port
  9. config_get_bool enabled "$section" 'enabled' 0
  10. config_get port "$section" 'port' 1026
  11. [ $enabled -gt 0 ] || return 1
  12. PHP_FCGI_CHILDREN='' \
  13. service_start /usr/bin/php-fcgi -b $port
  14. }
  15. start() {
  16. config_load 'php7-fastcgi'
  17. config_foreach start_instance 'php7-fastcgi'
  18. }
  19. stop() {
  20. service_stop /usr/bin/php-fcgi
  21. }