php.init 455 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. #PKG php
  3. #INIT 80
  4. . /etc/rc.conf
  5. export PHP_FCGI_CHILDREN='2'
  6. case $1 in
  7. autostop) ;;
  8. autostart)
  9. test x"${php:-NO}" = x"NO" && exit 0
  10. test x"$php" = x"DAEMON" && test -x /bin/mksh && exec mksh -T- $0 start
  11. exec sh $0 start
  12. ;;
  13. start)
  14. /usr/bin/php ${php_flags} &
  15. ;;
  16. stop)
  17. for i in $(pgrep -f /usr/bin/php);do kill -9 $i;done
  18. ;;
  19. restart)
  20. sh $0 stop
  21. sh $0 start
  22. ;;
  23. *)
  24. echo "Usage: $0 {start | stop | restart}"
  25. exit 1
  26. ;;
  27. esac
  28. exit $?