You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
729 B

  1. #!/bin/sh /etc/rc.common
  2. START=79
  3. start() {
  4. core_number=$(grep -c ^processor /proc/cpuinfo)
  5. /usr/sbin/uwsgi --ini /etc/uwsgi/uwsgi.conf --threads $core_number --processes $(($core_number * 2))
  6. logger -ts "Uwsgi" "Starting Uwsgi process"
  7. }
  8. stop() {
  9. pidfile="/var/run/uwsgi.pid"
  10. if [ -n "$(pgrep uwsgi)" ]; then
  11. if [ -f $pidfile ]; then
  12. logger -t "Uwsgi" "Stopping Uwsgi process"
  13. kill $( cat $pidfile )
  14. else
  15. for pid in $(pgrep uwsgi); do
  16. if [ -n "$(pgrep uwsgi)" ]; then
  17. #Keep trying to kill until the master process is found
  18. kill -KILL $pid
  19. fi
  20. done
  21. fi
  22. else
  23. logger -t "Uwsgi" "Uwsgi not running!"
  24. fi
  25. }
  26. reload() {
  27. /usr/sbin/uwsgi --reload /var/run/uwsgi.pid
  28. }