4
0

redhat 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. #
  3. # Corosync daemon init script for Red Hat Linux and compatibles.
  4. #
  5. # chkconfig: - 20 20
  6. # processname: corosync
  7. # pidfile: /var/run/corosync.pid
  8. # description: Corosync Cluster Engine
  9. # Source function library
  10. . /etc/rc.d/init.d/functions
  11. prog="corosync"
  12. exec="/usr/sbin/corosync"
  13. lockfile="/var/lock/subsys/corosync"
  14. [ -x "$exec" ] || exit 0
  15. start() {
  16. echo -n $"Starting Corosync Cluster Engine ($prog): "
  17. daemon $exec
  18. retval=$?
  19. [ "$retval" -eq 0 ] && touch "$lockfile"
  20. echo
  21. return $retval
  22. }
  23. stop() {
  24. echo -n $"Stopping Corosync Cluster Engine ($prog): "
  25. # If no signal is specified, -TERM is used but _also_ -KILL 3s later
  26. # This is far too aggressive for a cluster resource manager running on top of Corosync
  27. killproc $prog -TERM
  28. echo
  29. echo -n $"Waiting for services to unload:"
  30. while
  31. pidofproc $prog > /dev/null 2>&1
  32. do
  33. sleep 2
  34. done
  35. success $"$base shutdown"
  36. echo
  37. rm -f "$lockfile"
  38. return 0
  39. }
  40. restart() {
  41. stop
  42. start
  43. }
  44. case "$1" in
  45. start|stop|restart)
  46. $1
  47. ;;
  48. reload|force-reload)
  49. restart
  50. ;;
  51. condrestart|try-restart)
  52. [ ! -f "$lockfile" ] || restart
  53. ;;
  54. status)
  55. status $prog
  56. ;;
  57. *)
  58. echo $"Usage: $0 {start|stop|restart|try-restart|condrestart|reload|force-reload|status}"
  59. exit 2
  60. esac