Guest User

Untitled

a guest
Jun 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. #! /bin/sh
  2.  
  3. # File: /etc/init.d/unicorn
  4.  
  5. ### BEGIN INIT INFO
  6. # Provides: unicorn
  7. # Required-Start: $local_fs $remote_fs $network $syslog
  8. # Required-Stop: $local_fs $remote_fs $network $syslog
  9. # Default-Start: 2 3 4 5
  10. # Default-Stop: 0 1 6
  11. # Short-Description: starts the unicorn web server
  12. # Description: starts unicorn
  13. ### END INIT INFO
  14.  
  15. PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
  16. DAEMON=/usr/local/rvm/gems/ree-1.8.7-2010.02/bin/unicorn
  17. DAEMON_OPTS="-c /web_apps/example_rack_app/unicorn.rb -E production -D"
  18. NAME=unicorn
  19. DESC="Unicorn app for example_rack_app"
  20. PID=/web_apps/example_rack_app/pids/unicorn.pid
  21.  
  22. case "$1" in
  23. start)
  24. echo -n "Starting $DESC: "
  25. $DAEMON $DAEMON_OPTS
  26. echo "$NAME."
  27. ;;
  28. stop)
  29. echo -n "Stopping $DESC: "
  30. kill -QUIT `cat $PID`
  31. echo "$NAME."
  32. ;;
  33. restart)
  34. echo -n "Restarting $DESC: "
  35. kill -QUIT `cat $PID`
  36. sleep 1
  37. $DAEMON $DAEMON_OPTS
  38. echo "$NAME."
  39. ;;
  40. reload)
  41. echo -n "Reloading $DESC configuration: "
  42. kill -HUP `cat $PID`
  43. echo "$NAME."
  44. ;;
  45. *)
  46. echo "Usage: $NAME {start|stop|restart|reload}" >&2
  47. exit 1
  48. ;;
  49. esac
  50.  
  51. exit 0
Add Comment
Please, Sign In to add comment