Guest User

Untitled

a guest
Jun 18th, 2018
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.46 KB | None | 0 0
  1. ## openais.conf
  2.  
  3. root@ha1:/etc/ais# cat openais.conf
  4. # Please read the openais.conf.5 manual page
  5.  
  6. aisexec {
  7. user: root
  8. group: root
  9. }
  10.  
  11. totem {
  12. version: 2
  13. token: 10000
  14. token_retransmits_before_loss_const: 20
  15. join: 60
  16. consensus: 4800
  17. max_messages: 20
  18. clear_node_high_bit: yes
  19. secauth: off
  20. threads: 0
  21. rrp_mode: none
  22. vsftype: none
  23. interface {
  24. ringnumber: 0
  25. bindnetaddr: 192.168.7.0
  26. mcastaddr: 226.94.1.1
  27. mcastport: 5405
  28. }
  29. }
  30.  
  31. logging {
  32. fileline: off
  33. to_stderr: no
  34. to_syslog: yes
  35. syslog_facility: daemon
  36. logfile: /var/log/openais/openais.log
  37. debug: on
  38. timestamp: on
  39. logger_subsys {
  40. subsys: AMF
  41. debug: on
  42. tags: enter|leave|trace1|trace2|trace3|trace4|trace6
  43. }
  44. }
  45.  
  46. amf {
  47. mode: disabled
  48. }
  49.  
  50. service {
  51. # Load the Pacemaker Cluster Resource Manager (CRM)
  52. name: pacemaker
  53. ver: 0
  54. }
  55.  
  56. ## /etc/default/openais
  57. root@ha1:/etc/ais# cat /etc/default/openais
  58. # start openais at boot [yes|no]
  59. START=yes
  60.  
  61. ## init script...
  62. root@ha1:/etc/ais# cat /etc/init.d/openais
  63. #! /bin/sh
  64.  
  65. # Author: Fabio M. Di Nitto <fabbione@ubuntu.com>
  66.  
  67. # PATH should only include /usr/* if it runs after the mountnfs.sh script
  68. PATH=/usr/sbin:/usr/bin:/sbin:/bin
  69. DESC="openais daemon"
  70. NAME=aisexec
  71. DAEMON=/usr/sbin/$NAME
  72. DAEMON_ARGS=""
  73. PIDFILE=/var/run/$NAME.pid
  74. SCRIPTNAME=/etc/init.d/$NAME
  75.  
  76. # Exit if the package is not installed
  77. [ -x "$DAEMON" ] || exit 0
  78.  
  79. # Read configuration variable file if it is present
  80. [ -r /etc/default/openais ] && . /etc/default/openais
  81.  
  82. if [ "$START" != "yes" ]; then
  83. exit 0
  84. fi
  85.  
  86. # Load the VERBOSE setting and other rcS variables
  87. [ -f /etc/default/rcS ] && . /etc/default/rcS
  88.  
  89. # Define LSB log_* functions.
  90. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
  91. . /lib/lsb/init-functions
  92.  
  93. #
  94. # Function that starts the daemon/service
  95. #
  96. do_start()
  97. {
  98. # Return
  99. # 0 if daemon has been started
  100. # 1 if daemon was already running
  101. # 2 if daemon could not be started
  102. start-stop-daemon --start --quiet --exec $DAEMON --test > /dev/null \
  103. || return 1
  104. start-stop-daemon --start --quiet --exec $DAEMON -- $DAEMON_ARGS \
  105. || return 2
  106. # Add code here, if necessary, that waits for the process to be ready
  107. # to handle requests from services started subsequently which depend
  108. # on this one. As a last resort, sleep for some time.
  109. }
  110.  
  111. #
  112. # Function that stops the daemon/service
  113. #
  114. do_stop()
  115. {
  116. # Return
  117. # 0 if daemon has been stopped
  118. # 1 if daemon was already stopped
  119. # 2 if daemon could not be stopped
  120. # other if a failure occurred
  121. start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name $NAME
  122. RETVAL="$?"
  123. [ "$RETVAL" = 2 ] && return 2
  124. # Wait for children to finish too if this is a daemon that forks
  125. # and if the daemon is only ever run from this initscript.
  126. # If the above conditions are not satisfied then add some other code
  127. # that waits for the process to drop all resources that could be
  128. # needed by services started subsequently. A last resort is to
  129. # sleep for some time.
  130. start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
  131. [ "$?" = 2 ] && return 2
  132. # Many daemons don't delete their pidfiles when they exit.
  133. rm -f $PIDFILE
  134. return "$RETVAL"
  135. }
  136.  
  137. case "$1" in
  138. start)
  139. [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
  140. do_start
  141. case "$?" in
  142. 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  143. 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  144. esac
  145. ;;
  146. stop)
  147. [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
  148. do_stop
  149. case "$?" in
  150. 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  151. 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  152. esac
  153. ;;
  154. restart|force-reload)
  155. #
  156. # If the "reload" option is implemented then remove the
  157. # 'force-reload' alias
  158. #
  159. log_daemon_msg "Restarting $DESC" "$NAME"
  160. do_stop
  161. case "$?" in
  162. 0|1)
  163. do_start
  164. case "$?" in
  165. 0) log_end_msg 0 ;;
  166. 1) log_end_msg 1 ;; # Old process is still running
  167. *) log_end_msg 1 ;; # Failed to start
  168. esac
  169. ;;
  170. *)
  171. # Failed to stop
  172. log_end_msg 1
  173. ;;
  174. esac
  175. ;;
  176. *)
  177. #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
  178. echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
  179. exit 3
  180. ;;
  181. esac
  182.  
  183. :
  184.  
  185.  
  186. ## starting the daemon
  187. root@ha1:/etc/ais# /etc/init.d/openais start
  188. * Starting openais daemon aisexec [ OK ]
  189. root@ha1:/etc/ais#
Add Comment
Please, Sign In to add comment