Guest User

Untitled

a guest
Apr 23rd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # chkconfig: - 99 10
  4.  
  5. . /etc/rc.d/init.d/functions
  6.  
  7. DAEMON=/usr/bin/supervisord
  8. PIDFILE=/var/run/supervisord.pid
  9.  
  10. [ -x "$DAEMON" ] || exit 0
  11.  
  12. start() {
  13. echo -n "Starting supervisord: "
  14. if [ -f $PIDFILE ]; then
  15. PID=`cat $PIDFILE`
  16. echo supervisord already running: $PID
  17. exit 2;
  18. else
  19. daemon $DAEMON --pidfile=$PIDFILE -c /etc/supervisord.conf
  20. RETVAL=$?
  21. echo
  22. [ $RETVAL -eq 0 ] && touch /var/lock/subsys/supervisord
  23. return $RETVAL
  24. fi
  25. }
  26.  
  27. stop() {
  28. echo -n "Shutting down supervisord: "
  29. echo
  30. killproc -p $PIDFILE supervisord
  31. echo
  32. rm -f /var/lock/subsys/supervisord
  33. return 0
  34. }
  35.  
  36. case "$1" in
  37. start)
  38. start
  39. ;;
  40. stop)
  41. stop
  42. ;;
  43. status)
  44. status supervisord
  45. ;;
  46. restart)
  47. stop
  48. start
  49. ;;
  50. *)
  51. echo "Usage: {start|stop|status|restart}"
  52. exit 1
  53. ;;
  54. esac
  55. exit $?
Add Comment
Please, Sign In to add comment