redhat 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. DAEMON_COREFILE_LIMIT=unlimited
  15. [ -x "$exec" ] || exit 0
  16. start() {
  17. echo -n $"Starting Corosync Cluster Engine ($prog): "
  18. daemon $exec
  19. retval=$?
  20. [ "$retval" -eq 0 ] && touch "$lockfile"
  21. echo
  22. return $retval
  23. }
  24. stop() {
  25. echo -n $"Stopping Corosync Cluster Engine ($prog): "
  26. # If no signal is specified, -TERM is used but _also_ -KILL 3s later
  27. # This is far too aggressive for a cluster resource manager running on top of Corosync
  28. killproc $prog -TERM
  29. echo
  30. echo -n $"Waiting for services to unload:"
  31. while
  32. pidofproc $prog > /dev/null 2>&1
  33. do
  34. sleep 2
  35. done
  36. success $"$base shutdown"
  37. echo
  38. rm -f "$lockfile"
  39. return 0
  40. }
  41. restart() {
  42. stop
  43. start
  44. }
  45. case "$1" in
  46. start|stop|restart)
  47. $1
  48. ;;
  49. reload|force-reload)
  50. restart
  51. ;;
  52. condrestart|try-restart)
  53. [ ! -f "$lockfile" ] || restart
  54. ;;
  55. status)
  56. status $prog
  57. ;;
  58. *)
  59. echo $"Usage: $0 {start|stop|restart|try-restart|condrestart|reload|force-reload|status}"
  60. exit 2
  61. esac