glusterd-init 782 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. . /etc/rc.d/functions
  3. DAEMON=/usr/bin/glusterd
  4. NAME=`basename ${DAEMON}`
  5. OPT=""
  6. case "${1}" in
  7. start)
  8. log_info_msg "Starting ${NAME^} daemon..."
  9. pidlist=`pidofproc ${DAEMON}`
  10. if [ "${?}" = "0" ]; then
  11. log_info_msg2 " Already running"
  12. log_success_msg2
  13. exit 0;
  14. fi
  15. # Start as background process and assume OK
  16. ${DAEMON} $OPT &
  17. log_success_msg2
  18. ;;
  19. stop)
  20. log_info_msg "Stopping ${NAME^} daemon..."
  21. killproc ${DAEMON}
  22. evaluate_retval
  23. ;;
  24. restart)
  25. ${0} stop
  26. sleep 1
  27. ${0} start
  28. ;;
  29. status)
  30. statusproc ${DAEMON}
  31. ;;
  32. *)
  33. echo "Usage: ${0} {start|stop|restart|status}"
  34. exit 1
  35. ;;
  36. esac
  37. exit 0
  38. # End of service