Guest User

Untitled

a guest
Apr 18th, 2012
1,523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # /etc/init.d/resque
  4. #
  5. # init script for resque workers
  6. #
  7. #
  8. start() {
  9. echo -n "Starting resque..."
  10. cd /var/www/rhosyncapp1
  11. sudo -uwww-data QUEUE=* VERBOSE=1 /var/lib/gems/1.8/bin/rake resque:work --trace > /var/log/resque.log &
  12. return
  13. }
  14.  
  15. stop() {
  16. echo -n "Shutting down resque... "
  17. ps -ef | grep "resque:work" | head -n1 | awk '{ print $2 }' | xargs kill
  18. return
  19. }
  20.  
  21. case "$1" in
  22. start)
  23. start
  24. ;;
  25. stop)
  26. stop
  27. ;;
  28. restart)
  29. stop
  30. start
  31. ;;
  32.  
  33. tart)
  34. echo "Usage: {start|stop|restart}"
  35. exit 1
  36. ;;
  37. esac
  38. exit $?
Advertisement
Add Comment
Please, Sign In to add comment