supervisord.sh 984 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh
  2. #
  3. # /etc/rc.d/init.d/supervisord
  4. #
  5. # Supervisor is a client/server system that
  6. # allows its users to monitor and control a
  7. # number of processes on UNIX-like operating
  8. # systems.
  9. #
  10. # chkconfig: - 64 36
  11. # description: Supervisor Server
  12. # processname: supervisord
  13. # Source init functions
  14. . /etc/rc.d/init.d/functions
  15. prog="supervisord"
  16. prefix="/usr/"
  17. exec_prefix="${prefix}"
  18. prog_bin="${exec_prefix}/bin/supervisord"
  19. PIDFILE="/var/run/$prog.pid"
  20. start()
  21. {
  22. echo -n $"Starting $prog: "
  23. daemon $prog_bin --pidfile $PIDFILE -c /etc/supervisord.conf
  24. [ -f $PIDFILE ] && success $"$prog startup" || failure $"$prog startup"
  25. echo
  26. }
  27. stop()
  28. {
  29. echo -n $"Shutting down $prog: "
  30. [ -f $PIDFILE ] && killproc $prog || success $"$prog shutdown"
  31. echo
  32. }
  33. case "$1" in
  34. start)
  35. start
  36. ;;
  37. stop)
  38. stop
  39. ;;
  40. status)
  41. status $prog
  42. ;;
  43. restart)
  44. stop
  45. start
  46. ;;
  47. *)
  48. echo "Usage: $0 {start|stop|restart|status}"
  49. ;;
  50. esac