• R/O
  • HTTP
  • SSH
  • HTTPS

ultramonkey-l7-v2: コミット

UltraMonkey-L7 V2(single-thread implementation)


コミットメタ情報

リビジョンdafeaf3e15dbb9e4759ea68e9ca9c0bc0e561e7a (tree)
日時2010-10-27 13:34:44
作者TATEISHI Katsuyuki <kt@whee...>
コミッターTATEISHI Katsuyuki

ログメッセージ

doc/heartbeat-ra: Purge SSLProxy, VIPcheck

VIPcheck is now maintained at Linux-HA Japan(*1).
SSLProxy should be included in sslproxy package(*2).

*2 Latest version is
http://sourceforge.jp/projects/ultramonkey-l7/downloads/49046/SSLProxy.gz/
and it will be included in the next release of sslproxy packages.

変更サマリ

差分

--- a/doc/heartbeat-ra/Makefile.am
+++ b/doc/heartbeat-ra/Makefile.am
@@ -2,8 +2,6 @@ dist_doc_DATA = \
22 L7directord \
33 L7vsd \
44 README \
5- SSLProxy \
6- VIPcheck \
75 authkeys \
86 cib.xml-sample \
97 cib.xml-sample.sslproxy \
--- a/doc/heartbeat-ra/README
+++ b/doc/heartbeat-ra/README
@@ -3,8 +3,6 @@ Heartbeat Resource Agent and example configuration files.
33 == Files ==
44 L7directord: Resource Agent for l7directord.
55 L7vsd: Resource Agent for l7vsd.
6-SSLProxy: Resource Agent for sslproxy.
7-VIPcheck: Resource Agent for VIP.
86 authkeys: Heartbeat authkey example.
97 cib.xml-sample: Heartbeat cib.xml example.
108 cib.xml-sample.ssl:
--- a/doc/heartbeat-ra/SSLProxy
+++ /dev/null
@@ -1,236 +0,0 @@
1-#!/bin/sh
2-#
3-# This program is free software; you can redistribute it and/or modify
4-# it under the terms of version 2 of the GNU General Public License as
5-# published by the Free Software Foundation.
6-#
7-# This program is distributed in the hope that it would be useful, but
8-# WITHOUT ANY WARRANTY; without even the implied warranty of
9-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10-#
11-# Further, this software is distributed without any warranty that it is
12-# free of the rightful claim of any third person regarding infringement
13-# or the like. Any license provided herein, whether implied or
14-# otherwise, applies only to this software file. Patent licenses, if
15-# any, provided herein do not apply to combinations of this program with
16-# other software, or any other product whatsoever.
17-#
18-# You should have received a copy of the GNU General Public License
19-# along with this program; if not, write the Free Software Foundation,
20-# Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
21-#
22-
23-#######################################################################
24-# Initialization:
25-
26-#. ${OCF_ROOT}/resource.d/heartbeat/.ocf-shellfuncs
27-. /usr/lib/ocf/resource.d/heartbeat/.ocf-shellfuncs
28-
29-#######################################################################
30-
31-meta_data() {
32- cat <<END
33-<?xml version="1.0"?>
34-<!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
35-<resource-agent name="SSLProxy" version="1.0">
36-<version>1.0</version>
37-
38-<longdesc lang="en">
39-This is a SSLProxy Resource Agent.
40-</longdesc>
41-<shortdesc lang="en">SSLProxy resource agent</shortdesc>
42-
43-<parameters>
44-<parameter name="state" unique="1">
45-<longdesc lang="en">
46-Location to store the resource state in.
47-</longdesc>
48-<shortdesc lang="en">State file</shortdesc>
49-<content type="string" default="" />
50-</parameter>
51-
52-</parameters>
53-
54-<actions>
55-<action name="start" timeout="60" />
56-<action name="stop" timeout="60" />
57-<action name="monitor" timeout="60" interval="10" depth="0" start-delay="0" />
58-<action name="meta-data" timeout="5" />
59-</actions>
60-</resource-agent>
61-END
62-}
63-
64-#######################################################################
65-
66-sslproxy_usage() {
67- cat <<END
68-usage: $0 {start|stop|monitor|meta-data}
69-END
70-}
71-
72-###############################
73-# Logging Method
74-###############################
75-outputLog(){
76- MODE=$1
77- shift
78- case $MODE in
79- err) RET=$1; shift;
80- ocf_log $MODE "[$0 ${__OCF_ACTION}] NG;return=$RET" "$@";;
81- esac
82-}
83-
84-###############################
85-# kill process
86-###############################
87-sslproxy_pkill(){
88- pkill -9 sslproxy
89- ocf_log info "kill sslproxy process!"
90- while true
91- do
92- sleep 1
93- isRunning
94- RET=$?
95- if [ $RET -eq 0 ]; then
96- # stop OK
97- ocf_log info "sslproxy process stopped!"
98- return ${OCF_SUCCESS}
99- fi
100- done
101-}
102-
103-###############################
104-# Resource Running Check Method
105-###############################
106-isRunning(){
107- RET=0
108- RET=`pgrep -fox '/usr/sbin/sslproxy .*' | wc -l`
109- return $RET
110-}
111-
112-###############################
113-# Get Resource Status Method
114-###############################
115-sslproxy_status(){
116- T_ID=`/usr/sbin/sslproxyadm status | grep "TargetID" | wc -l`
117- RET=`/usr/sbin/sslproxyadm status | grep "Starting. PID =" | wc -l`
118- if [ $RET -eq 0 ]; then
119- MSG="sslproxy status ERROR!."
120- outputLog err ${OCF_ERR_GENERIC} ${MSG}
121- return ${OCF_ERR_GENERIC}
122- elif [ $RET -lt $T_ID ]; then
123- MSG="sslproxy status ERROR!(Target is insufficient)."
124- outputLog err ${OCF_ERR_GENERIC} ${MSG}
125- return ${OCF_ERR_GENERIC}
126-# elif [ $RET -gt $T_ID ]; then
127-# MSG="sslproxy status ERROR!(Target_ID exceeds a set value)."
128-# outputLog err ${OCF_ERR_GENERIC} ${MSG}
129-# return ${OCF_ERR_GENERIC}
130- fi
131- return ${OCF_SUCCESS}
132-}
133-
134-###############################
135-# Get Resource Monitor Method
136-###############################
137-sslproxy_monitor() {
138- isRunning;
139- RET=$?
140- if [ $RET -eq 0 ]; then
141- MSG="sslproxy is not running."
142- outputLog err ${OCF_NOT_RUNNING} ${MSG}
143- return ${OCF_NOT_RUNNING}
144- else
145- # sslproxy is running
146- sslproxy_status
147- if [ $? -eq ${OCF_SUCCESS} ]; then
148- # status OK
149- return ${OCF_SUCCESS}
150- else
151- break
152- fi
153- fi
154- MSG="sslproxy does not work."
155- outputLog err ${OCF_ERR_GENERIC} ${MSG}
156- return ${OCF_ERR_GENERIC}
157-}
158-
159-###############################
160-# Resource start Method
161-###############################
162-sslproxy_start() {
163- ocf_log info "sslproxy is starting ..."
164- sslproxy_monitor
165- RET=$?
166- if [ $RET -eq ${OCF_SUCCESS} ]; then
167- ocf_log info "sslproxy is already running."
168- return $OCF_SUCCESS
169- fi
170- /usr/sbin/sslproxyadm start > /dev/null 2>&1
171- RET=$?
172- if [ $RET -ne 0 ];then
173- MSG="sslproxy start error!."
174- outputLog err ${OCF_ERR_GENERIC} $MSG
175- return ${OCF_ERR_GENERIC}
176- fi
177- while true
178- do
179- isRunning;
180- RET=$?
181- if [ $RET -ne 0 ]; then
182- # sslproxy is running
183- ocf_log info "sslproxy starts."
184- return ${OCF_SUCCESS}
185- fi
186- sleep 1
187- done
188-}
189-
190-###############################
191-# Resource stop Method
192-###############################
193-sslproxy_stop() {
194- ocf_log info "sslproxy is stopping ..."
195- isRunning;
196- RET=$?
197- if [ $RET -eq 0 ]; then
198- ocf_log info "sslproxy stopped."
199- return ${OCF_SUCCESS}
200- fi
201- /usr/sbin/sslproxyadm stop > /dev/null 2>&1
202- count=0
203- while [ $count -le 10 ]
204- do
205- isRunning;
206- RET=$?
207- if [ $RET -eq 0 ]; then
208- ocf_log info "sslproxy stopped."
209- return ${OCF_SUCCESS}
210- fi
211- $count=`expr $count + 1`
212- sleep 1
213- done
214-
215- sslproxy_pkill
216- RET=$?
217-
218- return $RET
219-}
220-
221-case $__OCF_ACTION in
222-meta-data) meta_data
223- exit $OCF_SUCCESS ;;
224-start) sslproxy_start ;;
225-stop) sslproxy_stop ;;
226-monitor) sslproxy_monitor ;;
227-usage|help) sslproxy_usage
228- exit $OCF_SUCCESS
229- ;;
230-*) sslproxy_usage
231- exit $OCF_ERR_UNIMPLEMENTED
232- ;;
233-esac
234-rc=$?
235-ocf_log debug "${OCF_RESOURCE_INSTANCE} $__OCF_ACTION : $rc"
236-exit $rc
--- 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-
旧リポジトリブラウザで表示