• R/O
  • HTTP
  • SSH
  • HTTPS

ppp-resource-agents: 提交


Commit MetaInfo

修订版b398185a0c9c62a52726d42a40b06457d761a594 (tree)
时间2019-07-02 14:42:01
作者Tatsuki Sugiura <sugi@nemu...>
CommiterTatsuki Sugiura

Log Message

Merge branch 'master' into debian

更改概述

差异

--- a/PPPConnection
+++ b/PPPConnection
@@ -51,8 +51,8 @@ meta_data() {
5151 cat <<EOM
5252 <?xml version="1.0"?>
5353 <!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd">
54-<resource-agent name="PPPConnection" version="0.1">
55- <version>0.1</version>
54+<resource-agent name="PPPConnection">
55+ <version>0.2</version>
5656 <longdesc lang="en">
5757 Handle ppp connection as OCF resource. This resource calls pon/poff to connect ppp.
5858 </longdesc>
@@ -176,15 +176,6 @@ ppp_start() {
176176 sleep $OCF_RESKEY_pon_wait_sec
177177 fi
178178 done
179- tries=0
180- while ! ppp_check_ip; do
181- tries=`expr $tries + 1`
182- sleep 1
183- if [ "$tries" -gt "$OCF_RESKEY_ip_wait_sec" ]; then
184- ocf_log err "Timeout to aquire expected IP address ${IP4} ${IP6}."
185- return $OCF_ERR_GENERIC
186- fi
187- done
188179 return $OCF_SUCCESS
189180 }
190181
@@ -234,10 +225,16 @@ ppp_echo_status() {
234225 echo "disconnected"
235226 return 0
236227 fi
237- if ! ppp_check_ip; then
238- echo "connecting"
239- return 0
240- fi
228+ tries=0
229+ while ! ppp_check_ip; do
230+ tries=`expr $tries + 1`
231+ if [ "$tries" -gt "$OCF_RESKEY_ip_wait_sec" ]; then
232+ ocf_log err "Timeout for waiting expected IP address (${IP4} ${IP6})."
233+ echo "connecting"
234+ return 0
235+ fi
236+ sleep 1
237+ done
241238 echo "connected"
242239 return 0
243240 }
--- a/README.md
+++ b/README.md
@@ -7,9 +7,10 @@ Here is an example that connect `dsl-provider`
77 ```
88 primitive ppp-myisp PPPConnection \
99 params isp=dsl-provider \
10- op monitor interval=30 timeout=10 \
11- op start timeout=60 interval=0 \
12- op stop timeout=60 interval=0
10+ op monitor interval=30 timeout=10 on-fail=restart \
11+ op start timeout=60 interval=0 on-fail=restart \
12+ op stop timeout=60 interval=0 \
13+ meta failure-timeout=300
1314 ```
1415
1516 ## Option parameters
Show on old repository browser