tcms 603 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. USERNAME=$(bin/tcms-hostname --user)
  3. echo "tCMS running as user $USERNAME"
  4. [[ -e run/tcms.pid ]] && sudo pkill -F run/tcms.pid
  5. sudo www/server.psgi --listen run/tcms.sock --workers 20 --user "$USERNAME" --daemonize --pid run/tcms.pid
  6. #--chroot $(pwd)
  7. # Wait until the socket file is ready
  8. until [ -e run/tcms.sock ]
  9. do
  10. echo "Waiting for sock to be ready..."
  11. sleep 1
  12. done
  13. # Fix ownership of socket so nginx can see it
  14. sudo chown $USERNAME:www-data run/tcms.sock
  15. sudo chmod 0770 run/tcms.sock
  16. echo "tCMS running as PID "`cat run/tcms.pid`
  17. # Run reloader process
  18. #bin/tcms_monitor