Guest User

Untitled

a guest
Feb 20th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Init file for Gitorious Ultrasphinx daemon
  4. #
  5. # chkconfig: 2345 55 25
  6. # description: Ultrasphinx server daemon
  7. #
  8. # processname: searchd
  9. # pidfile: /var/www/gitorious/db/sphinx/log/searchd.pid
  10.  
  11. RETVAL=0
  12. START_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:start RAILS_ENV=production"
  13. STOP_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:stop RAILS_ENV=production"
  14. RESTART_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:restart RAILS_ENV=production"
  15. STATUS_CMD="cd /var/www/gitorious/ && rake ultrasphinx:daemon:status RAILS_ENV=production"
  16. LOCK_FILE=/var/lock/git-ultrasphinx
  17. PID_FILE=/var/www/gitorious/db/sphinx/log/searchd.pid
  18.  
  19. case "$1" in
  20. start)
  21. /bin/su - git -c "$START_CMD"
  22. ;;
  23. stop)
  24. /bin/su - git -c "$STOP_CMD"
  25. ;;
  26. status)
  27. /bin/su - git -c "$STATUS_CMD"
  28. ;;
  29. restart)
  30. /bin/su - git -c "$RESTART_CMD"
  31. ;;
  32. *)
  33. echo $"Usage: $0 {start|stop|restart|status}"
  34. RETVAL=1
  35. esac
  36. exit $RETVAL
Add Comment
Please, Sign In to add comment