tcms 600 B

123456789101112131415161718192021
  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 --chroot $(pwd)
  6. # Wait until the socket file is ready
  7. until [ -e run/tcms.sock ]
  8. do
  9. echo "Waiting for sock to be ready..."
  10. sleep 1
  11. done
  12. # Fix ownership of socket so nginx can see it
  13. sudo chown $USERNAME:www-data run/tcms.sock
  14. sudo chmod 0770 run/tcms.sock
  15. echo "tCMS running as PID "`cat run/tcms.pid`
  16. # Run reloader process
  17. bin/tcms_monitor