• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

UltraMonkey-L7 V3(multi-thread implementation)


Commit MetaInfo

Revisão0903ac689db508379195abb1a345fc24f313dadb (tree)
Hora2015-10-22 17:24:34
AutorMichiro Hibari <l05102@shib...>
CommiterMichiro Hibari

Mensagem de Log

Merge branch 'for_rhel7' into v3.1.3-devel

Mudança Sumário

Diff

--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
1+[Oct. 18 2015] 3.1.3-rc1 HIBARI Michiro
2+ - Add systemd unit file.
3+
14 [Sep. 11 2014] 3.1.2-1 HIBARI Michiro, Hiroaki Nakano
25 - Fixed degraded bug: re-patch for fixed #30300.
36
--- a/configure.in
+++ b/configure.ac
@@ -1,9 +1,9 @@
11 AC_PREREQ(2.59)
2-AC_INIT(l7vsd)
2+AC_INIT(l7vsd, 3.1.3, ultramonkey-l7-develop@lists.sourceforge.jp)
33 PACKAGENAME=l7vsd
4-VERSION=3.1.2
4+VERSION=3.1.3
55
6-AM_INIT_AUTOMAKE($PACKAGENAME, $VERSION, no-define )
6+AM_INIT_AUTOMAKE
77 AC_CONFIG_SRCDIR([config.h.in])
88 AC_CONFIG_HEADER([config.h])
99
@@ -14,6 +14,8 @@ AC_PROG_CPP
1414 AC_PROG_INSTALL
1515 AC_PROG_LN_S
1616 AC_PROG_MAKE_SET
17+AC_CHECK_PROG(check_systemd,systemctl,1,0)
18+AM_CONDITIONAL(CHECK_SYSTEMD, test $check_systemd -eq 1)
1719
1820 # Checks for libraries.
1921 AC_CHECK_LIB(dl, dlopen)
@@ -115,6 +117,7 @@ AC_CONFIG_FILES([doc/Makefile]
115117 [l7directord/Makefile]
116118 [l7vsd/Makefile]
117119 [l7vsd/init.d/Makefile]
120+ [l7vsd/systemd/Makefile]
118121 [l7vsd/module/Makefile]
119122 [l7vsd/module/protocol/Makefile]
120123 [l7vsd/module/schedule/Makefile]
--- a/doc/heartbeat-ra/L7directord
+++ b/doc/heartbeat-ra/L7directord
@@ -24,7 +24,9 @@
2424 # Initialization:
2525
2626 . ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
27-#. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
27+
28+L7DIRCONF=${OCF_RESKEY_configfile:-/etc/ha.d/conf/l7directord.cf}
29+L7DIRECTORD=${OCF_RESKEY_l7directord:-/usr/sbin/l7directord}
2830
2931 #######################################################################
3032
@@ -49,6 +51,22 @@ Location to store the resource state in.
4951 <content type="string" default="" />
5052 </parameter>
5153
54+<parameter name="configfile" unique="1">
55+<longdesc lang="en">
56+The full pathname of the l7directord configuration file.
57+</longdesc>
58+<shortdesc lang="en">configuration file path</shortdesc>
59+<content type="string" default="/etc/ha.d/conf/l7directord.cf" />
60+</parameter>
61+
62+<parameter name="l7directord">
63+<longdesc lang="en">
64+The full pathname of the l7directord.
65+</longdesc>
66+<shortdesc lang="en">ldirectord binary path</shortdesc>
67+<content type="string" default="/usr/sbin/l7directord" />
68+</parameter>
69+
5270 </parameters>
5371
5472 <actions>
@@ -109,7 +127,7 @@ l7directord_pkill(){
109127 ###############################
110128 isRunning(){
111129 RET=0
112- RET=`pgrep -fox "/usr/sbin/l7directord start" | wc -l`
130+ RET=`pgrep -fox "$L7DIRECTORD $L7DIRCONF start" | wc -l`
113131 return $RET
114132 }
115133
@@ -130,7 +148,7 @@ l7vsd_flush(){
130148 # Get Resource Status Method
131149 ###############################
132150 l7directord_status(){
133- /etc/init.d/l7directord status > /dev/null 2>&1
151+ $L7DIRECTORD $L7DIRCONF status > /dev/null 2>&1
134152 RET=$?
135153 if [ $RET -eq 0 ]; then
136154 return ${OCF_SUCCESS}
@@ -159,8 +177,6 @@ l7directord_monitor() {
159177 if [ $? -eq ${OCF_SUCCESS} ]; then
160178 # status OK
161179 return ${OCF_SUCCESS}
162- else
163- break
164180 fi
165181 elif [ $RET -eq 0 ]; then
166182 MSG="l7direcotrd is not running."
@@ -193,11 +209,12 @@ l7directord_start() {
193209 outputLog info "l7directord starts."
194210 return ${OCF_SUCCESS}
195211 elif [ $RET -eq 0 ]; then
196- /etc/init.d/l7directord start > /dev/null 2>&1
212+ $L7DIRECTORD $L7DIRCONF start > /dev/null 2>&1
197213 RET=$?
198214 if [ $RET -ne 0 ]; then
199215 MSG="l7directord start fatal error!: $RET"
200216 outputLog err ${OCF_ERR_GENERIC} $MSG
217+ return ${OCF_ERR_GENERIC}
201218 fi
202219 fi
203220 sleep 1
@@ -216,7 +233,7 @@ l7directord_stop() {
216233 l7vsd_flush
217234 return ${OCF_SUCCESS}
218235 elif [ $RET -eq 1 ]; then
219- /etc/init.d/l7directord stop > /dev/null 2>&1
236+ $L7DIRECTORD $L7DIRCONF stop > /dev/null 2>&1
220237 RET=$?
221238 if [ $RET -ne 0 ]; then
222239 MSG="l7directord stop fatal error!: $RET"
--- a/doc/heartbeat-ra/L7vsd
+++ b/doc/heartbeat-ra/L7vsd
@@ -24,7 +24,8 @@
2424 # Initialization:
2525
2626 . ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
27-#. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
27+
28+L7SOCKFILE=${OCF_RESKEY_socket_default:-/var/run/l7vs/l7vs}
2829
2930 #######################################################################
3031
@@ -40,8 +41,15 @@ This is a L7vsd Resource Agent.
4041 </longdesc>
4142 <shortdesc lang="en">L7vsd resource agent</shortdesc>
4243
43-<parameter/>
44-<parameters/>
44+<parameters>
45+<parameter name="socket" unique="0" required="0">
46+<longdesc lang="en">
47+The socket to be used for l7vsadm.
48+</longdesc>
49+<shortdesc lang="en">l7vsadm socket</shortdesc>
50+<content type="string" default="${OCF_RESKEY_socket_default}"/>
51+</parameter>
52+</parameters>
4553
4654 <actions>
4755 <action name="start" timeout="60" />
@@ -73,7 +81,16 @@ l7vsd_start() {
7381 ocf_log info "l7vsd is already running."
7482 return $OCF_SUCCESS
7583 elif [ $RET -eq $OCF_NOT_RUNNING ]; then
76- /etc/init.d/l7vsd start > /dev/null 2>&1
84+ L7SOCKDIR=`dirname L7SOCKFILE`
85+ if [ ! -d $L7SOCKDIR ] ; then
86+ ocf_log info "Creating l7vsadm socket dir: $L7SOCKDIR"
87+ mkdir -p $L7SOCKDIR
88+ fi
89+ if [ -e $L7SOCKFILE ] ; then
90+ ocf_log info "Delete l7vsadm socket filer: $L7SOCKFILE"
91+ rm -rf $L7SOCKFILE
92+ fi
93+ /usr/sbin/l7vsd > /dev/null 2>&1
7794 RET=$?
7895 if [ $RET -ne 0 ]; then
7996 MSG="l7vsd start error!"
@@ -97,19 +114,19 @@ l7vsd_start() {
97114 ###############################
98115 l7vsd_stop() {
99116 ocf_log info "l7vsd stopping ..."
100- isRunning;
117+ l7vsd_status
101118 RET=$?
102- if [ $RET -eq 0 ]; then
119+ if [ $RET -eq $OCF_NOT_RUNNING ]; then
103120 ocf_log info "l7vsd stopped."
104121 return $OCF_SUCCESS
105122 fi
106- /etc/init.d/l7vsd stop > /dev/null 2>&1
123+ pkill -f "/usr/sbin/l7vsd"
107124 count=0
108125 while [ $count -le 10 ]
109126 do
110- isRunning;
127+ l7vsd_status
111128 RET=$?
112- if [ $RET -eq 0 ]; then
129+ if [ $RET -eq $OCF_NOT_RUNNING ]; then
113130 ocf_log info "l7vsd stopped."
114131 return $OCF_SUCCESS
115132 fi
@@ -118,6 +135,7 @@ l7vsd_stop() {
118135 done
119136 l7vsd_pkill
120137 RET=$?
138+ rm -rf $L7SOCKFILE
121139 return $RET
122140 }
123141
@@ -144,9 +162,9 @@ l7vsd_pkill(){
144162 while true
145163 do
146164 sleep 1
147- isRunning;
165+ l7vsd_status
148166 RET=$?
149- if [ $RET -eq 0 ]; then
167+ if [ $RET -eq $OCF_NOT_RUNNING ]; then
150168 # stop OK
151169 ocf_log info "l7vsd process stopped!"
152170 return $OCF_SUCCESS
@@ -155,24 +173,19 @@ l7vsd_pkill(){
155173 }
156174
157175 ###############################
158-# Resource Running Check Method
159-###############################
160-isRunning(){
161- RET=0
162- RET=`pgrep -fox "/usr/sbin/l7vsd" | wc -l`
163- return $RET
164-}
165-
166-###############################
167176 # Get Resource Status Method
168177 ###############################
169178 l7vsd_status(){
170- /etc/init.d/l7vsd status > /dev/null 2>&1
171- RET=$?
172- if [ $RET -eq 0 ]; then
179+ RET=0
180+ RET=`pgrep -fox "/usr/sbin/l7vsd" | wc -l`
181+ if [ $RET -eq 1 ]; then
173182 return $OCF_SUCCESS
183+ elif [ $RET -eq 0 ]; then
184+ MSG="l7vsd is not running."
185+ outputLog $loglevel ${OCF_NOT_RUNNING} ${MSG}
186+ return $OCF_NOT_RUNNING
174187 else
175- MSG="l7vsd status ERROR!: $RET"
188+ MSG="l7vsd status ERROR!: (ps=$RET)"
176189 outputLog err ${OCF_ERR_GENERIC} ${MSG}
177190 return $OCF_ERR_GENERIC
178191 fi
@@ -188,23 +201,16 @@ l7vsd_monitor() {
188201 loglevel="info"
189202 fi
190203
191- isRunning;
204+ l7vsd_status
192205 RET=$?
193- if [ $RET -eq 1 ]; then
194- # l7vsd is running
195- l7vsd_status
196- if [ $? -eq $OCF_SUCCESS ]; then
197- # status OK
198- return $OCF_SUCCESS
199- else
200- break
201- fi
202- elif [ $RET -eq 0 ]; then
203- MSG="l7vsd is not running."
204- outputLog $loglevel ${OCF_NOT_RUNNING} ${MSG}
206+ if [ $RET -eq $OCF_SUCCESS ]; then
207+ # status OK
208+ return $OCF_SUCCESS
209+ elif [ $RET -eq $OCF_NOT_RUNNING ]; then
210+ # status NG
205211 return $OCF_NOT_RUNNING
206212 fi
207- MSG="l7vsd does not work. (ps=$RET) "
213+ MSG="l7vsd duplicated. "
208214 outputLog err ${OCF_ERR_GENERIC} ${MSG}
209215 return $OCF_ERR_GENERIC
210216 }
--- a/doc/heartbeat-ra/Makefile.am
+++ b/doc/heartbeat-ra/Makefile.am
@@ -4,11 +4,6 @@ UML7_VERSION = @ultramonkeyl7_version@
44 HB2_TEMPDIR = ${prefix}/share/doc/$(UML7_VERSION)/heartbeat-ra
55
66 install:
7- $(INSTALL) -b -m 644 -D ./logd.cf $(HB2_TEMPDIR)/logd.cf
8- $(INSTALL) -b -m 644 -D ./ha.cf $(HB2_TEMPDIR)/ha.cf
9- $(INSTALL) -b -m 600 -D ./authkeys $(HB2_TEMPDIR)/authkeys
10- $(INSTALL) -b -m 600 -D ./cib.xml-sample $(HB2_TEMPDIR)/cib.xml
117 $(INSTALL) -b -m 600 -D ./sample.crm $(HB2_TEMPDIR)/sample.crm
128 $(INSTALL) -b -m 755 -D ./L7vsd $(HB2_TEMPDIR)/L7vsd
139 $(INSTALL) -b -m 755 -D ./L7directord $(HB2_TEMPDIR)/L7directord
14- $(INSTALL) -b -m 755 -D ./VIPcheck $(HB2_TEMPDIR)/VIPcheck
--- a/doc/heartbeat-ra/README
+++ b/doc/heartbeat-ra/README
@@ -3,15 +3,11 @@ Heartbeat Resource Agent and example configuration files.
33 == Files ==
44 L7directord: Resource Agent for l7directord.
55 L7vsd: Resource Agent for l7vsd.
6-VIPcheck: Resource Agent for VIP.
7-authkeys: Heartbeat authkey example.
8-cib.xml-sample: Heartbeat cib.xml example.
9-ha.cf: Heartbeat ha.cf example.
10-logd.cf: Heartbeat logd.cf example.
6+sample.crm Pacemaker CRM example.
117
128 == Set up ==
13-See Heartbeat2 install manual for UltraMonkey-L7. (Japanese)
14-http://osdn.jp/projects/ultramonkey-l7/docs/?category_id=964
9+See Pacemaker install manual for UltraMonkey-L7. (Japanese)
10+https://osdn.jp/projects/ultramonkey-l7/docs/?category_id=1148
1511
1612 You can use Resource Agents as they are. But you must edit at
1713 least IP addresses in configuration files.
--- a/doc/heartbeat-ra/VIPcheck
+++ /dev/null
@@ -1,150 +0,0 @@
1-#!/bin/sh
2-#
3-#
4-# This program is free software; you can redistribute it and/or modify
5-# it under the terms of version 2 of the GNU General Public License as
6-# published by the Free Software Foundation.
7-#
8-# This program is distributed in the hope that it would be useful, but
9-# WITHOUT ANY WARRANTY; without even the implied warranty of
10-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11-#
12-# Further, this software is distributed without any warranty that it is
13-# free of the rightful claim of any third person regarding infringement
14-# or the like. Any license provided herein, whether implied or
15-# otherwise, applies only to this software file. Patent licenses, if
16-# any, provided herein do not apply to combinations of this program with
17-# other software, or any other product whatsoever.
18-#
19-# You should have received a copy of the GNU General Public License
20-# along with this program; if not, write the Free Software Foundation,
21-# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
22-#
23-
24-#######################################################################
25-# Initialization:
26-
27-. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
28-#. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
29-
30-#######################################################################
31-
32-meta_data() {
33- cat <<END
34-<?xml version="1.0"?>
35-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
36-<resource-agent name="VIPcheck" version="0.1">
37-<version>1.0</version>
38-
39-<longdesc lang="en">
40-This is a VIPcheck Resource Agent.
41-</longdesc>
42-<shortdesc lang="en">VIPcheck resource agent</shortdesc>
43-
44-<parameters>
45-<parameter name="target_ip" unique="1">
46-<longdesc lang="en">
47-ping target VIP address.
48-</longdesc>
49-<shortdesc lang="en">target ip</shortdesc>
50-<content type="string" default="" />
51-</parameter>
52-
53-<parameter name="count" unique="1">
54-<longdesc lang="en">
55-repeat times
56-</longdesc>
57-<shortdesc lang="en">repeat times</shortdesc>
58-<content type="integer" default="1" />
59-</parameter>
60-
61-<parameter name="wait" unique="1">
62-<longdesc lang="en">
63-wait times
64-</longdesc>
65-<shortdesc lang="en">wait times</shortdesc>
66-<content type="integer" default="10" />
67-</parameter>
68-
69-</parameters>
70-
71-<actions>
72-<action name="start" timeout="60" />
73-<action name="stop" timeout="60" />
74-<action name="monitor" timeout="60" interval="10" depth="0" start-delay="0" />
75-<action name="meta-data" timeout="5" />
76-</actions>
77-</resource-agent>
78-END
79-}
80-
81-#######################################################################
82-
83-VIPcheck_usage() {
84- cat <<END
85-usage: $0 {start|stop|monitor|meta-data}
86-
87-Expects to have a fully populated OCF RA-compliant environment set.
88-END
89-}
90-
91-VIPcheck_start() {
92- VIPcheck_monitor
93- if [ $? = $OCF_SUCCESS ]; then
94- return $OCF_SUCCESS
95- fi
96-
97- ping ${OCF_RESKEY_target_ip} -c ${OCF_RESKEY_count} -w ${OCF_RESKEY_wait} > /dev/null 2>&1
98- prc=$?
99- ocf_log debug "target_ip = $OCF_RESKEY_target_ip, count = $OCF_RESKEY_count, wait = $OCF_RESKEY_wait"
100- ocf_log debug "ping return code = $prc"
101- if [ $prc = 0 ]; then
102- # pingが通った-->ERROR
103- return $OCF_ERR_GENERIC
104- else
105- # pingが通らない --> 成功
106- touch ${OCF_RESKEY_state}
107- return $OCF_SUCCESS
108- fi
109-}
110-
111-VIPcheck_stop() {
112- VIPcheck_monitor
113- if [ $? = $OCF_SUCCESS ]; then
114- rm ${OCF_RESKEY_state}
115- fi
116- return $OCF_SUCCESS
117-}
118-
119-VIPcheck_monitor() {
120- if [ -f ${OCF_RESKEY_state} ]; then
121- return $OCF_SUCCESS
122- fi
123- if false ; then
124- return $OCF_ERR_GENERIC
125- fi
126- return $OCF_NOT_RUNNING
127-}
128-
129-: ${OCF_RESKEY_wait=10}
130-: ${OCF_RESKEY_count=1}
131-: ${OCF_RESKEY_state=${HA_RSCTMP}/VIPcheck-${OCF_RESOURCE_INSTANCE}.state}
132-
133-case $__OCF_ACTION in
134-meta-data) meta_data
135- exit $OCF_SUCCESS
136- ;;
137-start) VIPcheck_start;;
138-stop) VIPcheck_stop;;
139-monitor) VIPcheck_monitor;;
140-usage|help) VIPcheck_usage
141- exit $OCF_SUCCESS
142- ;;
143-*) VIPcheck_usage
144- exit $OCF_ERR_UNIMPLEMENTED
145- ;;
146-esac
147-rc=$?
148-ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
149-exit $rc
150-
--- a/doc/heartbeat-ra/authkeys
+++ /dev/null
@@ -1,2 +0,0 @@
1-auth 1
2-1 sha1 ClusterKey01
--- a/doc/heartbeat-ra/cib.xml-sample
+++ /dev/null
@@ -1,94 +0,0 @@
1- <cib admin_epoch="0" epoch="0" num_updates="0">
2- <configuration>
3- <crm_config>
4- <cluster_property_set id="cib-bootstrap-options">
5- <attributes>
6- <nvpair id="cib-bootstrap-options-no-quorum-policy" name="no-quorum-policy" value="ignore"/>
7- <nvpair id="cib-bootstrap-options-stonith-enabled" name="stonith-enabled" value="false"/>
8- <nvpair id="cib-bootstrap-options-default-resource-stickiness" name="default-resource-stickiness" value="INFINITY"/>
9- <nvpair id="cib-bootstrap-options-default-resource-failure-stickiness" name="default-resource-failure-stickiness" value="-INFINITY"/>
10- <nvpair id="cib-bootstrap-options-default-action-timeout" name="default-action-timeout" value="120s"/>
11- </attributes>
12- </cluster_property_set>
13- </crm_config>
14- <nodes/>
15- <resources>
16- <group id="grpUltraMonkey1">
17- <primitive id="prmVIPcheck" class="ocf" type="VIPcheck" provider="heartbeat">
18- <instance_attributes id="prmVIPcheck_instance_attrs">
19- <attributes>
20- <nvpair id="atr:VIPcheck:ex:VIPcheck:target_ip" name="target_ip" value="192.168.1.200"/>
21- <nvpair id="atr:VIPcheck:ex:VIPcheck:count" name="count" value="1"/>
22- <nvpair id="atr:VIPcheck:ex:VIPcheck:wait" name="wait" value="10"/>
23- </attributes>
24- </instance_attributes>
25- <operations>
26- <op id="op:VIPcheck:ex:VIPcheck:start" name="start" timeout="90s" on_fail="restart" start_delay="4s"/>
27- </operations>
28- </primitive>
29- <primitive id="prmVIP" class="ocf" type="IPaddr2" provider="heartbeat">
30- <instance_attributes id="prmVIP_instance_attrs">
31- <attributes>
32- <nvpair id="atr:VIP:ex:IPadder2:ip" name="ip" value="192.168.1.200"/>
33- <nvpair id="atr:VIP:ex:IPadder2:nic" name="nic" value="eth0"/>
34- <nvpair id="atr:VIP:ex:IPadder2:cidr_netmask" name="cidr_netmask" value="24"/>
35- </attributes>
36- </instance_attributes>
37- <operations>
38- <op id="op:VIP:ex:IPadder2:start" name="start" timeout="60s" on_fail="restart"/>
39- <op id="op:VIP:ex:IPadder2:monitor" name="monitor" interval="10s" timeout="60s" on_fail="restart"/>
40- <op id="op:VIP:ex:IPadder2:stop" name="stop" timeout="60s" on_fail="block"/>
41- </operations>
42- </primitive>
43- <primitive id="prmL7directord" class="ocf" type="L7directord" provider="heartbeat">
44- <operations>
45- <op id="op:L7directord:ex:L7directord:start" name="start" timeout="60s" on_fail="restart"/>
46- <op id="op:L7directord:ex:L7directord:monitor" name="monitor" interval="10s" timeout="60s" on_fail="restart"/>
47- <op id="op:L7directord:ex:L7directord:stop" name="stop" timeout="60s" on_fail="block"/>
48- </operations>
49- </primitive>
50- </group>
51- <clone id="grpClone1" ordered="false" interleave="false" notify="false" globally_unique="false">
52- <instance_attributes id="grpClone1_attrs">
53- <attributes>
54- <nvpair id="atr:Clone1:ex:clone:clone_max" name="clone_max" value="2"/>
55- <nvpair id="atr:Clone1:ex:clone:clone_node_max" name="clone_node_max" value="1"/>
56- </attributes>
57- </instance_attributes>
58- <primitive id="prmL7vsd" class="ocf" type="L7vsd" provider="heartbeat">
59- <operations>
60- <op id="op:L7vsd:ex:L7vsd:start" name="start" timeout="60s" on_fail="restart"/>
61- <op id="op:L7vsd:ex:L7vsd:monitor" name="monitor" interval="10s" timeout="60s" on_fail="restart"/>
62- <op id="op:L7vsd:ex:L7vsd:stop" name="stop" timeout="60s" on_fail="block"/>
63- </operations>
64- </primitive>
65- </clone>
66- </resources>
67- <constraints>
68- <rsc_colocation id="colocation_UltraMonkey1_and_Clone1" from="grpUltraMonkey1" to="grpClone1" score="INFINITY"/>
69- <rsc_location id="location_node01_200" rsc="grpUltraMonkey1">
70- <rule id="prefered_location_node01_200" score="200">
71- <expression attribute="#uname" id="location:grpUltraMonkey:node01" operation="eq" value="LB01"/>
72- </rule>
73- </rsc_location>
74- <rsc_location id="location_node02_100" rsc="grpUltraMonkey1">
75- <rule id="prefered_location_node02_100" score="100">
76- <expression attribute="#uname" id="location:grpUltraMonkey:node02" operation="eq" value="LB02"/>
77- </rule>
78- </rsc_location>
79- <rsc_location id="rul_PN1_dsc" rsc="grpUltraMonkey1">
80- <rule id="prefered_rul_PN1_dsc" score="-INFINITY" boolean_op="and">
81- <expression attribute="default_ping_set" id="PN1_dsc:expr:defined" operation="defined"/>
82- <expression attribute="default_ping_set" id="PN1_dsc:expr:lt" operation="lt" value="100"/>
83- </rule>
84- </rsc_location>
85- <rsc_location id="rul_diskcheck_status_internal" rsc="grpUltraMonkey1">
86- <rule id="preferd_diskcheck_status_internal" score="-INFINITY" boolean_op="and">
87- <expression attribute="diskcheck_status_internal" id="diskcheck_status_internal:defined" operation="defined"/>
88- <expression attribute="diskcheck_status_internal" id="diskcheck_status_internal:eq" operation="eq" value="ERROR"/>
89- </rule>
90- </rsc_location>
91- <rsc_order id="order_UltraMonkey1_and_Clone1" from="grpClone1" action="start" type="before" to="grpUltraMonkey1" score="0"/>
92- </constraints>
93- </configuration>
94- </cib>
--- a/doc/heartbeat-ra/ha.cf
+++ /dev/null
@@ -1,21 +0,0 @@
1-crm on
2-use_logd on
3-
4-debug 0
5-udpport 694
6-keepalive 2
7-warntime 7
8-deadtime 10
9-initdead 48
10-
11-bcast eth2
12-bcast eth3
13-
14-node hpww0101
15-node hpww0201
16-
17-watchdog /dev/watchdog
18-respawn root /usr/lib64/heartbeat/pingd -m 100 -a default_ping_set
19-ping 192.168.43.14
20-respawn root /usr/lib64/heartbeat/diskd -N /dev/sda -a diskcheck_status_internal -i 10
21-respawn root /etc/ha.d/monitoring/heartbeat_logmoni.sh monitor
--- a/doc/heartbeat-ra/logd.cf
+++ /dev/null
@@ -1,3 +0,0 @@
1-logfile /var/log/ha-log
2-debugfile /var/log/ha-debug
3-logfacility none
--- a/doc/heartbeat-ra/sample.crm
+++ b/doc/heartbeat-ra/sample.crm
@@ -1,9 +1,7 @@
11 ### Cluster Option ###
22 property no-quorum-policy="ignore" \
33 stonith-enabled="false" \
4- startup-fencing="false" \
5- stonith-timeout="750s" \
6- crmd-transition-delay=2s
4+ startup-fencing="false"
75
86 ### Resource Defaults ###
97 rsc_defaults resource-stickiness="INFINITY" \
@@ -26,13 +24,16 @@ group grpUltraMonkey \
2624 prmL7directord
2725 #group grpStonith1 \
2826 # prmStonith1-1 \
29-# prmStonith1-2 \
30-# prmStonith1-3
27+# prmStonith1-2
3128
3229 #group grpStonith2 \
3330 # prmStonith2-1 \
34-# prmStonith2-2 \
35-# prmStonith2-3
31+# prmStonith2-2
32+
33+### Fencing Topology ###
34+#fencing_topology \
35+# MODIFY_PRYMARY_HOST: prmStonith1-1 prmStonith1-2 \
36+# MODIFY_SECONDARY_HOST: prmStonith2-1 prmStonith2-2
3637
3738 ### Primitive Configuration ###
3839 primitive prmVIPcheck ocf:heartbeat:VIPcheck \
@@ -61,11 +62,14 @@ primitive prmL7vsd ocf:heartbeat:L7vsd \
6162 op monitor interval="10s" timeout="60s" on-fail="restart" \
6263 op stop interval="0s" timeout="60s" on-fail="block"
6364
64-primitive prmPingd ocf:pacemaker:pingd \
65+primitive prmPing ocf:pacemaker:ping \
6566 params \
6667 name="default_ping_set" \
6768 host_list="MODIFY_PING_TARGET_IP" \
6869 multiplier="100" \
70+ attempts="2" \
71+ timeout="2" \
72+ debug="true" \
6973 op start interval="0s" timeout="60s" on-fail="restart" \
7074 op monitor interval="10s" timeout="60s" on-fail="restart" \
7175 op stop interval="0s" timeout="60s" on-fail="ignore"
@@ -81,58 +85,47 @@ primitive prmDiskd ocf:pacemaker:diskd \
8185
8286 #primitive prmStonith1-1 stonith:external/stonith-helper \
8387 # params \
84-# priority="1" \
88+# pcmk_reboot_retries="1" \
8589 # stonith-timeout="40s" \
8690 # hostlist="MODIFY_PRYMARY_HOST" \
8791 # dead_check_target="MODIFY_TARGET_IP MODIFY_TARGET_IP ..." \
88-# standby_check_command="/usr/sbin/crm_resource -r prmVIP -W | grep -q `hostname`" \
89-# op start interval="0s" timeout="60s" \
90-# op monitor interval="10s" timeout="60s" \
91-# op stop interval="0s" timeout="60s"
92+# standby_check_command="/usr/sbin/crm_resource -r prmL7directord -W | grep -q `hostname`" \
93+# run_online_check="yes" \
94+# op start interval="0s" timeout="60s" on-fail="restart" \
95+# op stop interval="0s" timeout="60s" on-fail="ignore"
9296
9397 #primitive prmStonith1-2 stonith:external/ipmi \
9498 # params \
99+# pcmk_reboot_timeout="60s" \
95100 # passwd="MODIFY_IPMI_PASSWORD" \
96101 # ipaddr="MODIFY_IPMI_IP" \
97-# priority="2" \
98102 # userid="MODIFY_IPMI_USER" \
99103 # hostname="MODIFY_PRYMARY_HOST" \
100104 # interface="MODIFY_IPMI_INTERFACE" \
101-# stonith-timeout="60s" \
102-# op start interval="0s" timeout="60s" \
103-# op monitor interval="3600s" timeout="60s" \
104-# op stop interval="0s" timeout="60s"
105-
106-#primitive prmStonith1-3 stonith:meatware \
107-# params \
108-# priority="3" \
109-# stonith-timeout="600s" \
110-# hostlist="MODIFY_PRYMARY_HOST" \
111-# op start interval="0s" timeout="60s" \
112-# op monitor interval="3600s" timeout="60s" \
113-# op stop interval="0s" timeout="60s"
105+# op start interval="0s" timeout="60s" on-fail="restart" \
106+# op monitor interval="3600s" timeout="60s" on-fail="restart" \
107+# op stop interval="0s" timeout="60s" on-fail="ignore"
114108
115109 #primitive prmStonith2-1 stonith:external/stonith-helper \
116110 # params \
117-# priority="1" \
111+# pcmk_reboot_retries="1" \
118112 # stonith-timeout="40s" \
119113 # hostlist="MODIFY_SECONDARY_HOST" \
120114 # dead_check_target="MODIFY_TARGET_IP MODIFY_TARGET_IP ..." \
121-# standby_check_command="/usr/sbin/crm_resource -r prmVIP -W | grep -q `hostname`" \
122-# op start interval="0s" timeout="60s" \
123-# op monitor interval="10s" timeout="60s" \
124-# op stop interval="0s" timeout="60s"
115+# standby_check_command="/usr/sbin/crm_resource -r prmL7directord -W | grep -q `hostname`" \
116+# run_online_check="yes" \
117+# op start interval="0s" timeout="60s" on-fail="restart" \
118+# op stop interval="0s" timeout="60s" on-fail="ignore"
125119
126120 #primitive prmStonith2-2 stonith:external/ipmi \
127121 # params \
122+# pcmk_reboot_timeout="60s" \
128123 # passwd="MODIFY_IPMI_PASSWORD" \
129124 # ipaddr="MODIFY_IPMI_IP" \
130-# priority="2" \
131125 # userid="MODIFY_IPMI_USER" \
132126 # hostname="MODIFY_SECONDARY_HOST" \
133127 # interface="MODIFY_IPMI_INTERFACE" \
134-# stonith-timeout="60s" \
135-# op start interval="0s" timeout="60s" \
128+# op start interval="0s" timeout="60s" onfail\
136129 # op monitor interval="3600s" timeout="60s" \
137130 # op stop interval="0s" timeout="60s"
138131
@@ -141,9 +134,9 @@ primitive prmDiskd ocf:pacemaker:diskd \
141134 # priority="3" \
142135 # stonith-timeout="600s" \
143136 # hostlist="MODIFY_SECONDARY_HOST" \
144-# op start interval="0s" timeout="60s" \
145-# op monitor interval="3600s" timeout="60s" \
146-# op stop interval="0s" timeout="60s"
137+# op start interval="0s" timeout="60s" on-fail="restart" \
138+# op monitor interval="3600s" timeout="60s" on-fail="restart" \
139+# op stop interval="0s" timeout="60s" on-fail="ignore"
147140
148141 ### Resource Location ###
149142 location rsc_location-grpUltraMonkey-1 grpUltraMonkey \
--- a/l7directord/Makefile.am
+++ b/l7directord/Makefile.am
@@ -4,5 +4,8 @@ SBINDIR = @sbindir@
44
55 install:
66 $(INSTALL) -m 755 -D ./l7directord $(SBINDIR)/l7directord
7+if CHECK_SYSTEMD
8+ $(INSTALL) -m 644 -D ./systemd/l7directord.service ${prefix}/lib/systemd/system/l7directord.service
9+else
710 $(INSTALL) -m 755 -D ./init.d/l7directord ${sysconfdir}/rc.d/init.d/l7directord
8-
11+endif
--- /dev/null
+++ b/l7directord/init.d/l7directord.service
@@ -0,0 +1,14 @@
1+[Unit]
2+Description=UltraMonkey-L7 healthcheck daemon
3+After=syslog.target network.target nss-lookup.service
4+
5+[Service]
6+Type=forking
7+EnvironmentFile=/etc/ha.d/conf/l7directord.cf
8+ExecStart=/usr/sbin/l7directord start
9+ExecReload=/usr/sbin/l7directord reload
10+ExecStop=/usr/sbin/l7directord stop
11+PIDFile=/var/run/l7directord.l7directord.pid
12+
13+[Install]
14+WantedBy=multi-user.target
--- /dev/null
+++ b/l7directord/systemd/l7directord.service
@@ -0,0 +1,13 @@
1+[Unit]
2+Description=UltraMonkey-L7 healthcheck daemon
3+After=syslog.target network.target nss-lookup.service l7vsd.service
4+
5+[Service]
6+Type=forking
7+ExecStart=/usr/sbin/l7directord /etc/ha.d/conf/l7directord.cf start
8+ExecReload=/usr/sbin/l7directord /etc/ha.d/conf/l7directord.cf reload
9+ExecStop=/usr/sbin/l7directord /etc/ha.d/conf/l7directord.cf stop
10+PIDFile=/var/run/l7directord.l7directord.pid
11+
12+[Install]
13+WantedBy=multi-user.target
--- a/l7vsd/Makefile.am
+++ b/l7vsd/Makefile.am
@@ -1,2 +1,2 @@
11 AUTOMAKE_OPTIONS = foreign
2-SUBDIRS = init.d src module include
2+SUBDIRS = init.d systemd src module include
--- a/l7vsd/init.d/Makefile.am
+++ b/l7vsd/init.d/Makefile.am
@@ -1,4 +1,6 @@
11 AUTOMAKE_OPTIONS = foreign
22
33 install:
4+if !CHECK_SYSTEMD
45 $(INSTALL) -m 755 -D ./l7vsd ${sysconfdir}/rc.d/init.d/l7vsd
6+endif
--- /dev/null
+++ b/l7vsd/init.d/l7vsd.service
@@ -0,0 +1,14 @@
1+[Unit]
2+Description=UltraMonkey-L7 loadbalancing daemon
3+After=syslog.target network.target nss-lookup.service
4+
5+[Service]
6+Type=oneshot
7+# LimitNOFILE=65536
8+EnvironmentFile=/etc/l7vs/l7vs.cf
9+ExecStart=/usr/sbin/l7vsd
10+ExecStop=/bin/kill $MAINPID
11+RemainAfterExit=yes
12+
13+[Install]
14+WantedBy=multi-user.target
--- a/l7vsd/src/Makefile.am
+++ b/l7vsd/src/Makefile.am
@@ -173,6 +173,7 @@ l7vsd_LDADD = \
173173 -lboost_system-mt \
174174 -lboost_serialization-mt \
175175 -lnetsnmpmibs -lnetsnmpagent -lnetsnmphelpers -lnetsnmp \
176+ -lpthread \
176177 @external_agent_libs@
177178
178179 l7vsadm_CPPFLAGS = \
@@ -197,6 +198,7 @@ l7vsadm_LDADD = \
197198 libl7vsadm_parameter.a \
198199 -llog4cxx \
199200 -lrt \
201+ -lpthread \
200202 -lboost_thread-mt \
201203 -lboost_system-mt \
202204 -lboost_serialization-mt \
--- /dev/null
+++ b/l7vsd/systemd/Makefile.am
@@ -0,0 +1,6 @@
1+AUTOMAKE_OPTIONS = foreign
2+
3+install:
4+if CHECK_SYSTEMD
5+ $(INSTALL) -m 644 -D ./l7vsd.service ${prefix}/lib/systemd/system/l7vsd.service
6+endif
--- /dev/null
+++ b/l7vsd/systemd/l7vsd.service
@@ -0,0 +1,13 @@
1+[Unit]
2+Description=UltraMonkey-L7 loadbalancing daemon
3+After=syslog.target network.target nss-lookup.service
4+Before=l7directord.service
5+
6+[Service]
7+Type=forking
8+ExecStartPre=/bin/rm -rf /var/run/l7vs/l7vs
9+ExecStart=/usr/sbin/l7vsd
10+ExecStop=/bin/kill $MAINPID
11+ExecStopPost=/bin/rm -rf /var/run/l7vs/l7vs
12+[Install]
13+WantedBy=multi-user.target
--- a/ultramonkeyl7.spec
+++ b/ultramonkeyl7.spec
@@ -6,8 +6,8 @@
66
77 Summary: The Layer-7 Virtual Server
88 Name: ultramonkeyl7
9-Version: 3.1.2
10-Release: 1%{?dist}
9+Version: 3.1.3
10+Release: rc1%{?dist}
1111 License: LGPLv2.1
1212 Group: System Environment/Daemons
1313 URL: http://osdn.jp/projects/ultramonkey-l7/
@@ -27,6 +27,14 @@ Requires: perl-Crypt-SSLeay
2727 Requires: perl-Net-SSLeay
2828 Requires: perl-IO-Socket-SSL
2929 Requires: perl-IO-Socket-INET6
30+Requires: perl-Time-HiRes
31+
32+%if 0%{?fedora} >= 15 || 0%{?centos_version} >= 7 || 0%{?rhel} >= 7
33+Requires: perl-LWP-Protocol-https
34+Requires: perl-Sys-Syslog
35+Requires: perl-autodie
36+Requires: systemd
37+%endif
3038
3139 %define hb2_tempdir /usr/share/doc/%{name}-%{version}/heartbeat-ra
3240 %define mibs_tempdir /usr/share/doc/%{name}-%{version}/mibs
@@ -51,6 +59,9 @@ for UltraMonkeyl7's module.
5159 ./configure \
5260 --prefix=%{_prefix} \
5361 --sysconfdir=%{_sysconfdir} \
62+%if %{defined _unitdir}
63+ --with-systemdsystemunitdir=%{_unitdir} \
64+%endif
5465 --localstatedir=%{_localstatedir} \
5566 --libdir=%{_libdir}
5667
@@ -63,7 +74,11 @@ mkdir -p ${RPM_BUILD_ROOT}%{_sbindir}
6374 mkdir -p -m 755 ${RPM_BUILD_ROOT}%{_sysconfdir}/l7vs
6475 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/l7vs/sslproxy
6576 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/ha.d/conf
77+%if %{defined _unitdir}
78+mkdir -p ${RPM_BUILD_ROOT}%{_unitdir}
79+%else
6680 mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/rc.d/init.d
81+%endif
6782 mkdir -p -m 755 ${RPM_BUILD_ROOT}%{l7vs_moddir}
6883 mkdir -p ${RPM_BUILD_ROOT}%{l7vs_logdir}
6984 mkdir -p ${RPM_BUILD_ROOT}%{l7vsadm_sockdir}
@@ -81,22 +96,37 @@ mkdir -p ${RPM_BUILD_ROOT}%{_includedir}
8196 rm -rf $RPM_BUILD_ROOT
8297
8398 %post
84-chkconfig --add l7vsd
85-chkconfig --add l7directord
99+%if %{defined _unitdir}
100+ systemctl daemon-reload
101+%else
102+ chkconfig --add l7vsd
103+ chkconfig --add l7directord
104+%endif
86105
87106 %preun
88107 if [ $1 = 0 ]; then
108+%if %{defined _unitdir}
109+ systemctl disable l7directord > /dev/null 2>&1
110+ systemctl disable l7vsd > /dev/null 2>&1
111+ systemctl stop l7directord > /dev/null 2>&1
112+ systemctl stop l7vsd > /dev/null 2>&1
113+%else
89114 /sbin/service l7directord stop > /dev/null 2>&1
90115 /sbin/service l7vsd stop > /dev/null 2>&1
91116 chkconfig --del l7vsd
92117 chkconfig --del l7directord
118+%endif
93119 fi
94120
95121 %files
96122 %defattr(-, root, root, 0755)
97123 %{_sbindir}/*
98124 %{l7vs_moddir}/*
125+%if %{defined _unitdir}
126+%{_unitdir}/*
127+%else
99128 %{_sysconfdir}/rc.d/init.d/*
129+%endif
100130 %dir %{l7vs_moddir}
101131 %dir %{l7vs_logdir}
102132 %dir %{_sysconfdir}/l7vs
@@ -133,7 +163,11 @@ fi
133163 %{moduledevel_tempdir}/*
134164
135165 %changelog
136-* Wed Sep 11 2014 Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp> 3.1.2-1
166+* Sun Oct 18 2015 HIBARI Michiro <l05102@shibaura-it.ac.jp> 3.1.3-rc1
167+- Update for 3.1.3-rc1
168+- Add systemd Unit file.
169+
170+* Wed Sep 10 2014 Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp> 3.1.2-1
137171 - Update for 3.1.2-1
138172 - Marge from 3.1.2-devel to master. And modefy version.
139173 - Fixed degraded bug: re-patch for fixed ticket 30300.
@@ -159,7 +193,7 @@ fi
159193 * Wed Aug 1 2012 Hiroaki Nakano <nakano.hiroaki@nttcom.co.jp> 3.0.4-rc1
160194 - Update for 3.0.4-rc1
161195
162-* Thu Dec 20 2011 HIBARI Michiro <hibari.michirou@nttcom.co.jp> 3.0.3-1
196+* Tue Dec 20 2011 HIBARI Michiro <hibari.michirou@nttcom.co.jp> 3.0.3-1
163197 - Update for 3.0.3-1
164198
165199 * Thu Feb 10 2011 HIBARI Michiro <hibari.michirou@nttcom.co.jp> 3.0.2-1