Re: [Linux-ha-dev] sfex RA: Refine start/stop method

2010-06-15 Thread NAKAHIRA Kazutomo
Hi, Dejan,

Thank you for your speedy response.

But, the patch seems not to be applied to the 
"http://hg.linux-ha.org/agents"; repository now.

Could you please apply this patch to the agents repository?

Best regards,
NAKAHIRA Kazutomo

(2010/06/14 18:05), Dejan Muhamedagic wrote:
> Hi Kazutomo-san,
>
> On Mon, Jun 14, 2010 at 10:48:03AM +0900, NAKAHIRA Kazutomo wrote:
>> Hi, all
>>
>> I refined a sfex RA to speed up start/stop process of the sfex.
>>
>> An attached patch modify static "sleep 2/4" in a sfex RA.
>> Please see attached and comment me if there are any suggestions.
>
> Patch applied. I just changed wording in some log messages.
>
> Cheers,
>
> Dejan
>
>> Best regards,
>> NAKAHIRA Kazutomo
>>
>> --
>> NTT Open Source Software Center
>> Infrastructure Software Technology Unit
>
>> # HG changeset patch
>> # User NAKAHIRA Kazutomo
>> # Date 1276475594 -32400
>> # Node ID a4627a7bbf3d1efdb2fd3742100128297179ffd9
>> # Parent  cbd80d4017c85878017c2651149e2ba23691ce17
>> sfex RA: Refine sfex_daemon start-up/shutodown method.
>>
>> diff -r cbd80d4017c8 -r a4627a7bbf3d heartbeat/sfex
>> --- a/heartbeat/sfex Tue Jun 08 20:07:16 2010 +0200
>> +++ b/heartbeat/sfex Mon Jun 14 09:33:14 2010 +0900
>> @@ -133,12 +133,16 @@
>>  return $OCF_ERR_GENERIC
>>  fi
>>  
>> -sleep 2
>> -sfex_monitor
>> -if [ $? -eq $OCF_SUCCESS ]; then
>> -ocf_log info "sfex_daemon: started."
>> -return $OCF_SUCCESS
>> -fi
>> +while :
>> +do
>> +sfex_monitor
>> +if [ $? -eq $OCF_SUCCESS ]; then
>> +ocf_log info "sfex_daemon: started."
>> +return $OCF_SUCCESS
>> +fi
>> +ocf_log debug "Waiting for the start-up of the sfex_daemon..."
>> +sleep 1
>> +done
>>  ocf_log err "Can't find a sfex_daemon process. Starting a sfex_daemon 
>> failed."
>>  return $OCF_ERR_GENERIC
>>   }
>> @@ -168,13 +172,36 @@
>>   #sfex could be in state D if the device is gone, and then not terminate.   
>>   #Wait and check again if the daemon is already properly shutdown.
>>
>> -sleep 4
>> +shutdown_timeout=$((($OCF_RESKEY_CRM_meta_timeout/1000)-5))
>> +count=0
>> +while [ $count -lt $shutdown_timeout ]
>> +do
>> +sfex_monitor
>> +if [ $? -eq $OCF_NOT_RUNNING ]; then
>> +ocf_log info "sfex_daemon: stopped."
>> +return $OCF_SUCCESS
>> +fi
>> +count=`expr $count + 1`
>> +ocf_log debug "Waiting for the shutdown of the 
>> sfex_daemon($count/$shutdown_timeout)."
>> +sleep 1
>> +done
>> +
>>  sfex_monitor
>> -rc=$?
>> -if [ $rc -ne $OCF_NOT_RUNNING ]; then
>> -ocf_log err "sfex_daemon failed to stop"
>> -return $rc
>> +if [ $? -ne $OCF_NOT_RUNNING ]; then
>> +ocf_log warn "Waiting for the shutdown of the sfex_daemon is 
>> time-out. Now stopping sfex_daemon using SIGKILL."
>> +/bin/kill -s KILL $pid
>>  fi
>> +
>> +while :
>> +do
>> +sfex_monitor
>> +if [ $? -eq $OCF_NOT_RUNNING ]; then
>> +break;
>> +fi
>> +ocf_log debug "Waiting for the kill -KILL of the sfex_daemon."
>> +sleep 1
>> +done
>> +
>>  ocf_log info "sfex_daemon: stopped."
>>  return $OCF_SUCCESS
>>   }
>
>> ___
>> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
>> Home Page: http://linux-ha.org/
>
> ___
> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>


-- 
NAKAHIRA Kazutomo
NTT Open Source Software Center
Infrastructure Software Technology Unit
___
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


Re: [Linux-ha-dev] sfex RA: Refine start/stop method

2010-06-15 Thread Dejan Muhamedagic
Hi Kazutomo-san,

On Tue, Jun 15, 2010 at 06:47:22PM +0900, NAKAHIRA Kazutomo wrote:
> Hi, Dejan,
> 
> Thank you for your speedy response.
> 
> But, the patch seems not to be applied to the 
> "http://hg.linux-ha.org/agents"; repository now.

Happens now and again :)

> Could you please apply this patch to the agents repository?

Done know.

Cheers,

Dejan

> Best regards,
> NAKAHIRA Kazutomo
> 
> (2010/06/14 18:05), Dejan Muhamedagic wrote:
> > Hi Kazutomo-san,
> >
> > On Mon, Jun 14, 2010 at 10:48:03AM +0900, NAKAHIRA Kazutomo wrote:
> >> Hi, all
> >>
> >> I refined a sfex RA to speed up start/stop process of the sfex.
> >>
> >> An attached patch modify static "sleep 2/4" in a sfex RA.
> >> Please see attached and comment me if there are any suggestions.
> >
> > Patch applied. I just changed wording in some log messages.
> >
> > Cheers,
> >
> > Dejan
> >
> >> Best regards,
> >> NAKAHIRA Kazutomo
> >>
> >> --
> >> NTT Open Source Software Center
> >> Infrastructure Software Technology Unit
> >
> >> # HG changeset patch
> >> # User NAKAHIRA Kazutomo
> >> # Date 1276475594 -32400
> >> # Node ID a4627a7bbf3d1efdb2fd3742100128297179ffd9
> >> # Parent  cbd80d4017c85878017c2651149e2ba23691ce17
> >> sfex RA: Refine sfex_daemon start-up/shutodown method.
> >>
> >> diff -r cbd80d4017c8 -r a4627a7bbf3d heartbeat/sfex
> >> --- a/heartbeat/sfex   Tue Jun 08 20:07:16 2010 +0200
> >> +++ b/heartbeat/sfex   Mon Jun 14 09:33:14 2010 +0900
> >> @@ -133,12 +133,16 @@
> >>return $OCF_ERR_GENERIC
> >>fi
> >>
> >> -  sleep 2
> >> -  sfex_monitor
> >> -  if [ $? -eq $OCF_SUCCESS ]; then
> >> -  ocf_log info "sfex_daemon: started."
> >> -  return $OCF_SUCCESS
> >> -  fi
> >> +  while :
> >> +  do
> >> +  sfex_monitor
> >> +  if [ $? -eq $OCF_SUCCESS ]; then
> >> +  ocf_log info "sfex_daemon: started."
> >> +  return $OCF_SUCCESS
> >> +  fi
> >> +  ocf_log debug "Waiting for the start-up of the sfex_daemon..."
> >> +  sleep 1
> >> +  done
> >>ocf_log err "Can't find a sfex_daemon process. Starting a sfex_daemon 
> >> failed."
> >>return $OCF_ERR_GENERIC
> >>   }
> >> @@ -168,13 +172,36 @@
> >>   #sfex could be in state D if the device is gone, and then not terminate. 
> >>   #Wait and check again if the daemon is already properly shutdown.
> >>
> >> -  sleep 4
> >> +  shutdown_timeout=$((($OCF_RESKEY_CRM_meta_timeout/1000)-5))
> >> +  count=0
> >> +  while [ $count -lt $shutdown_timeout ]
> >> +  do
> >> +  sfex_monitor
> >> +  if [ $? -eq $OCF_NOT_RUNNING ]; then
> >> +  ocf_log info "sfex_daemon: stopped."
> >> +  return $OCF_SUCCESS
> >> +  fi
> >> +  count=`expr $count + 1`
> >> +  ocf_log debug "Waiting for the shutdown of the 
> >> sfex_daemon($count/$shutdown_timeout)."
> >> +  sleep 1
> >> +  done
> >> +  
> >>sfex_monitor
> >> -  rc=$?
> >> -  if [ $rc -ne $OCF_NOT_RUNNING ]; then
> >> -  ocf_log err "sfex_daemon failed to stop"
> >> -  return $rc
> >> +  if [ $? -ne $OCF_NOT_RUNNING ]; then
> >> +  ocf_log warn "Waiting for the shutdown of the sfex_daemon is 
> >> time-out. Now stopping sfex_daemon using SIGKILL."
> >> +  /bin/kill -s KILL $pid
> >>fi
> >> +
> >> +  while :
> >> +  do
> >> +  sfex_monitor
> >> +  if [ $? -eq $OCF_NOT_RUNNING ]; then
> >> +  break;
> >> +  fi
> >> +  ocf_log debug "Waiting for the kill -KILL of the sfex_daemon."
> >> +  sleep 1
> >> +  done
> >> +
> >>ocf_log info "sfex_daemon: stopped."
> >>return $OCF_SUCCESS
> >>   }
> >
> >> ___
> >> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> >> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> >> Home Page: http://linux-ha.org/
> >
> > ___
> > Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> > Home Page: http://linux-ha.org/
> >
> 
> 
> -- 
> NAKAHIRA Kazutomo
> NTT Open Source Software Center
> Infrastructure Software Technology Unit
> ___
> Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
___
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/