Guest User

Untitled

a guest
Dec 10th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. #!/bin/sh
  2. # Amazon Linux AMI startup script for a supervisor instance
  3. #
  4. # chkconfig: 2345 80 20
  5. # description: Autostarts supervisord.
  6.  
  7. # Source function library.
  8. . /etc/rc.d/init.d/functions
  9.  
  10. supervisorctl="/usr/bin/supervisorctl"
  11. supervisord="/usr/bin/supervisord"
  12. name="supervisor-python"
  13.  
  14. [ -f $supervisord ] || exit 1
  15. [ -f $supervisorctl ] || exit 1
  16.  
  17. RETVAL=0
  18.  
  19. start() {
  20. echo -n "Starting $name: "
  21. $supervisord
  22. RETVAL=$?
  23. echo
  24. return $RETVAL
  25. }
  26.  
  27. stop() {
  28. echo -n "Stopping $name: "
  29. $supervisorctl shutdown
  30. RETVAL=$?
  31. echo
  32. return $RETVAL
  33. }
  34.  
  35. case "$1" in
  36. start)
  37. start
  38. ;;
  39.  
  40. stop)
  41. stop
  42. ;;
  43.  
  44. restart)
  45. stop
  46. start
  47. ;;
  48. esac
  49.  
  50. exit $REVAL
Add Comment
Please, Sign In to add comment