Guest User

Untitled

a guest
Apr 25th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. # Copyright (c) 2007 Bradley Taylor, bradley@railsmachine.com
  4. #
  5. # mongrel_cluster Startup script for Mongrel clusters.
  6. #
  7. # chkconfig: - 85 15
  8. # description: mongrel_cluster manages multiple Mongrel processes for use \
  9. # behind a load balancer.
  10. #
  11.  
  12. CONF_DIR=/var/www/YOURAPP/current/config
  13. PID_DIR=/var/www/YOURAPP/current/tmp/pids
  14. USER=mongrel
  15.  
  16. RETVAL=0
  17.  
  18. # Gracefully exit if the controller is missing.
  19. which mongrel_cluster_ctl >/dev/null || exit 0
  20.  
  21. # Go no further if config directory is missing.
  22. [ -d "$CONF_DIR" ] || exit 0
  23.  
  24. case "$1" in
  25. start)
  26. # Create pid directory
  27. mkdir -p $PID_DIR
  28. chown $USER:$USER $PID_DIR
  29.  
  30. # remove stale pids
  31. rm -f $PID_DIR/mongrel.80*
  32.  
  33. mongrel_cluster_ctl start -c $CONF_DIR
  34. RETVAL=$?
  35. ;;
  36. stop)
  37. mongrel_cluster_ctl stop -c $CONF_DIR
  38. RETVAL=$?
  39. ;;
  40. restart)
  41. # remove stale pids
  42. rm -f $PID_DIR/mongrel.80*
  43.  
  44. mongrel_cluster_ctl restart -c $CONF_DIR
  45. RETVAL=$?
  46. ;;
  47. status)
  48. mongrel_cluster_ctl status -c $CONF_DIR
  49. RETVAL=$?
  50. ;;
  51. *)
  52. echo "Usage: mongrel_cluster {start|stop|restart|status}"
  53. exit 1
  54. ;;
  55. esac
  56.  
  57. exit $RETVAL
Add Comment
Please, Sign In to add comment