Re: [Linux-ha-dev] change of process check in tomcat-ra

2011-11-10 Thread nozawat
Hi Dejan

>What is overwritten?Which environment variable do you refer to?
It is CATALINA_OPTS.

When CATALINA_OPTS is set from the outside, a right process check is
not possible.
It occurs at following time.
1.-Dname is not set(Outside setting).
2.When -Dname is different.
3.When setting of CATALINA_OPTS is different by cib and outside setting

When I set CATALINA_OPTS in the tomcat-ra from the outside, there is
the same definition to two places(cib and setenv.sh),and When I set
-Dname definitely.
It moves. However, is not it confusing?

Regards,
Tomo

2011/11/10 Dejan Muhamedagic :
> On Fri, Nov 04, 2011 at 01:55:57PM +0900, nozawat wrote:
>> Hi Dejan
>>
>> > Are we sure that the pid file is _always_ going to exist and
>> > contain the PID?
>> I believe that PID file exists, and I include pid.
>> BTW, it is the next sentence to be important by this change.
>>
>> > What's wrong with setting the tomcat_name parameter when it's really
>> > needed (i.e. it is different from the default "tomcat")?
>> For example, it may not move when CATALINA_OPTS is catalina.sh and is
>> overwritten.
>> It is to move without a problem even if an environment variable is set
>> from the outside that I need.
>
> I'm sorry, but I don't understand much of this. Could you please
> rephrase. "may not move", what may (not) move? What is
> overwritten? Which environment variable do you refer to?
>
> Cheers,
>
> Dejan
>
>> Regards,
>> Tomo
>>
>> 2011/11/4 Dejan Muhamedagic :
>> > Hi,
>> >
>> > On Tue, Nov 01, 2011 at 09:31:10AM +0900, nozawat wrote:
>> >> Hi Dejan
>> >>
>> >>  Sorry,I got a wrong attached file.
>> >>  I send a right file.
>> >
>> > Are we sure that the pid file is _always_ going to exist and
>> > contain the PID? What's wrong with setting the tomcat_name
>> > parameter when it's really needed (i.e. it is different from the
>> > default "tomcat")?
>> >
>> > If you don't produce good arguments, this change looks
>> > superfluous to me.
>> >
>> > Cheers,
>> >
>> > Dejan
>> >
>> >> Regards,
>> >> Tomo
>> >>
>> >> 2011/11/1 Dejan Muhamedagic :
>> >> > Hi,
>> >> >
>> >> > On Thu, Oct 27, 2011 at 11:36:10AM +0900, nozawat wrote:
>> >> >> Hi
>> >> >>
>> >> >>  I changed the method of the process check in tomcat-ra.
>> >> >>  SEARCH_STR does not function when I set tomcat parameter in 
>> >> >> catalina.sh.
>> >> >
>> >> > This is the same one like the other to remove the pid file.
>> >> > Wrong patch attached?
>> >> >
>> >> > Thanks,
>> >> >
>> >> > Dejan
>> >> >
>> >> >> Regards,
>> >> >> Tomo
>> >> >
>> >> >
>> >> >> ___
>> >> >> 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/
>> >> >
>> >
>> >
>> >> ___
>> >> 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/
>> >
>> ___
>> 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/
>
___
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] [Linux-HA] [RfC] Review request for ocf:heartbeat:asterisk (Asterisk OCF RA)

2011-11-10 Thread Florian Haas
On 2011-11-10 17:08, Dejan Muhamedagic wrote:
> Hi Lars,
> 
> Pity I didn't see this earlier, could've saved meself some time :)
> 
> On Thu, Nov 10, 2011 at 04:33:02PM +0100, Lars Ellenberg wrote:
>> On Thu, Nov 10, 2011 at 04:11:16PM +0100, Florian Haas wrote:
>>> Hi Dejan,
>>>
>>> thanks for the feedback! We've worked in most of your suggested changes,
>>> see below:
>>
 More direct would be:

 if [ $? -ne 0 ]; then
>>
>>  $? in a test is almost always an error.
> 
> Unless you don't need the outcome later.

I'm with you, however Lars did evidently spot the one occasion where we
used $? twice trying to get the same return code. So he wins. :)

https://github.com/fghaas/resource-agents/commit/2cbb26648c133ce04b0d51e439c41541dac039e1

I left one invocation in there: "asterisk_validate || exit $?". I hope
that one is acceptable. :)

>> Btw,
>>  "User $OCF_RESKEY_user doesn't exit"
>>  there is an s missing.
> 
> "user doesn't exit" sounds good too ;-)

https://github.com/fghaas/resource-agents/commit/1568a990dfcac03ddfe5785c5d65940ed230068c

We also tossed in a few more changes:

Properly handle multiple instances of the "astcanary" watchdog daemon:
https://github.com/fghaas/resource-agents/commit/c257d4a57f9131a4353143991fe101f02b51d790

Remove a pointless "return $?"
https://github.com/fghaas/resource-agents/commit/812f2b55b9a7a9f8bdd270cca8d037f07f0e980a

Fix a couple of log messages, and exit where we shouldn't return:
https://github.com/fghaas/resource-agents/commit/58b5f55da4ac5537acf9a36b56f8b35f2b96da56

Cheers,
Florian


-- 
Need help with High Availability?
http://www.hastexo.com/now
___
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] Patch: iscsi RA

2011-11-10 Thread Dejan Muhamedagic
On Thu, Nov 10, 2011 at 04:10:29PM +, Matthew Richardson wrote:
> On 10/11/11 12:39, Dejan Muhamedagic wrote:
> > Hi,
> > 
> > On Thu, Nov 10, 2011 at 10:11:30AM +, Matthew Richardson wrote:
> >> In newer versions of iscsid (RHEL6) the init.d script has been changed,
> >> such that the start method won't do anything unless discovery etc has
> >> already occurred at least once.
> >>
> >> As a result, there's now a new option in iscsid.conf - 'iscsid.startup'
> >> which you can set to be a command to be run when iscsiadm is unable to
> >> connect to the iscsid daemon:
> >>
> >> http://groups.google.com/group/open-iscsi/browse_thread/thread/afdaaedad9050da8
> > 
> > Interesting. Some people are bored.
> > 
> >> The iscsi RA shouldn't fail if it notices iscsid isn't running if this
> >> value is set - this patch checks the config file to see if it exists,
> >> and if it does, doesn't return an error.
> > 
> > OK. If that doesn't help, it's going to fail later anyway.
> > 
> >> One side-effect of this change in behaviour is that this startup will
> >> only be carried out for certain iscsiadm actions.  Since (in RH anyway)
> >> the init.d script also loads the iscsi kernel modules, some actions in
> >> the RA will now fail if these modules haven't been loaded.
> > 
> > I'm not sure I understand this. How would it work without the RA?
> > Do people still need to invoke again /etc/init.d/iscsi start?
> > Aren't modules loaded anyway on start? If not, what loads them
> > later?
> 
> I'll try to explain the side-effect a bit better if I can.
> 
> Previously, running the iscsid init script would try to load iscsid
> kernel modules, then launch the daemon.  However, the changes to the
> script causes it to not start if iscsid has never run before on the
> system, unless you call it with 'force-start' instead of just 'start'.
> 
> In what seems to be a big hack, it looks like the iscsid.startup value
> is recommended (on RH anyway) to be '/etc/rc.d/init.d/iscsid
> force-start' which should give the same effect as most people achieved
> before using an lsb primitive rule to call this script.
> 
> The problem is that iscsiadm discoverydb commands need the kernel
> modules loaded before they will call the startup command,  so you have
> to load them beforehand elsewhere:
> 
> /tmp$ iscsiadm -m discoverydb -p 192.168.140.10:3260 -t sendtargets -D
> iscsiadm: Could not scan /sys/class/iscsi_transport.
> iscsiadm: iSCSI driver tcp is not loaded. Load the module then retry the
> command.
> iscsiadm: Could not perform SendTargets discovery: iSCSI driver not
> found. Please make sure it is loaded, and retry the operation
> 
> /tmp$ modprobe iscsi_tcp
> 
> /tmp$ iscsiadm -m discoverydb -p 192.168.140.10:3260 -t sendtargets -D
> Starting iscsid:   [  OK  ]
> 192.168.140.10:3260,1 iqn.2010-05.uk.ac.ed.eng:w3718
> 
> 
> Hopefully this all makes sense (the explanation and the patch, not the
> change to iscsid :) )

Oh, yes, it does. I was just hoping that it wouldn't be this
ridiculous.

> > Did you already try this patch?
> > 
> 
> Yes, I'm running it on my test systems without any apparent problems
> (though I am having to load the kernel modules at boot).

I'll apply the patch, but anyway people will need to deal with
loading modules themselves.

Many thanks for the contribution.

Cheers,

Dejan

> Thanks,
> 
> Matthew
> 
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> 



> ___
> 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/


Re: [Linux-ha-dev] Patch: iscsi RA

2011-11-10 Thread Matthew Richardson
On 10/11/11 12:39, Dejan Muhamedagic wrote:
> Hi,
> 
> On Thu, Nov 10, 2011 at 10:11:30AM +, Matthew Richardson wrote:
>> In newer versions of iscsid (RHEL6) the init.d script has been changed,
>> such that the start method won't do anything unless discovery etc has
>> already occurred at least once.
>>
>> As a result, there's now a new option in iscsid.conf - 'iscsid.startup'
>> which you can set to be a command to be run when iscsiadm is unable to
>> connect to the iscsid daemon:
>>
>> http://groups.google.com/group/open-iscsi/browse_thread/thread/afdaaedad9050da8
> 
> Interesting. Some people are bored.
> 
>> The iscsi RA shouldn't fail if it notices iscsid isn't running if this
>> value is set - this patch checks the config file to see if it exists,
>> and if it does, doesn't return an error.
> 
> OK. If that doesn't help, it's going to fail later anyway.
> 
>> One side-effect of this change in behaviour is that this startup will
>> only be carried out for certain iscsiadm actions.  Since (in RH anyway)
>> the init.d script also loads the iscsi kernel modules, some actions in
>> the RA will now fail if these modules haven't been loaded.
> 
> I'm not sure I understand this. How would it work without the RA?
> Do people still need to invoke again /etc/init.d/iscsi start?
> Aren't modules loaded anyway on start? If not, what loads them
> later?

I'll try to explain the side-effect a bit better if I can.

Previously, running the iscsid init script would try to load iscsid
kernel modules, then launch the daemon.  However, the changes to the
script causes it to not start if iscsid has never run before on the
system, unless you call it with 'force-start' instead of just 'start'.

In what seems to be a big hack, it looks like the iscsid.startup value
is recommended (on RH anyway) to be '/etc/rc.d/init.d/iscsid
force-start' which should give the same effect as most people achieved
before using an lsb primitive rule to call this script.

The problem is that iscsiadm discoverydb commands need the kernel
modules loaded before they will call the startup command,  so you have
to load them beforehand elsewhere:

/tmp$ iscsiadm -m discoverydb -p 192.168.140.10:3260 -t sendtargets -D
iscsiadm: Could not scan /sys/class/iscsi_transport.
iscsiadm: iSCSI driver tcp is not loaded. Load the module then retry the
command.
iscsiadm: Could not perform SendTargets discovery: iSCSI driver not
found. Please make sure it is loaded, and retry the operation

/tmp$ modprobe iscsi_tcp

/tmp$ iscsiadm -m discoverydb -p 192.168.140.10:3260 -t sendtargets -D
Starting iscsid:   [  OK  ]
192.168.140.10:3260,1 iqn.2010-05.uk.ac.ed.eng:w3718


Hopefully this all makes sense (the explanation and the patch, not the
change to iscsid :) )

>
> Did you already try this patch?
> 

Yes, I'm running it on my test systems without any apparent problems
(though I am having to load the kernel modules at boot).

Thanks,

Matthew

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.



signature.asc
Description: OpenPGP digital signature
___
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] [Linux-HA] [RfC] Review request for ocf:heartbeat:asterisk (Asterisk OCF RA)

2011-11-10 Thread Dejan Muhamedagic
Hi Lars,

Pity I didn't see this earlier, could've saved meself some time :)

On Thu, Nov 10, 2011 at 04:33:02PM +0100, Lars Ellenberg wrote:
> On Thu, Nov 10, 2011 at 04:11:16PM +0100, Florian Haas wrote:
> > Hi Dejan,
> > 
> > thanks for the feedback! We've worked in most of your suggested changes,
> > see below:
> 
> > > More direct would be:
> > > 
> > > if [ $? -ne 0 ]; then
> 
>  $? in a test is almost always an error.

Unless you don't need the outcome later.

>  Because you lose the actual value it had.
>  So rather ex=$?, [ $ex ... ], and add $ex to the log message.
> 
>  Yo have that error also later in "Asterisk start command failed: $?",
>  that will always log 0.
> 
> compare the output of the next two lines.
>  ( (exit 7); if [ $? -ne 0 ]; then echo "ALWAYS 0!! exit code: $?"; fi )
>  ( (exit 7); ex=$?; if [ $ex -ne 0 ]; then echo "exit code: $ex"; fi )
> 
> Btw,
>  "User $OCF_RESKEY_user doesn't exit"
>  there is an s missing.

"user doesn't exit" sounds good too ;-)

Cheers,

Dejan

> 
> -- 
> : Lars Ellenberg
> : LINBIT | Your Way to High Availability
> : DRBD/HA support and consulting http://www.linbit.com
> ___
> 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/


Re: [Linux-ha-dev] [Linux-HA] [RfC] Review request for ocf:heartbeat:asterisk (Asterisk OCF RA)

2011-11-10 Thread Dejan Muhamedagic
Hey Florian,

On Thu, Nov 10, 2011 at 04:11:16PM +0100, Florian Haas wrote:
> Hi Dejan,
> 
> thanks for the feedback! We've worked in most of your suggested changes,
> see below:
> 
> On 2011-11-10 13:14, Dejan Muhamedagic wrote:
> > Hi,
[...]
> > Start may exit with some arbitrary error code (line 324 in
> > asterisk_start()).

I was referring to this, it should really be fixed:

ocf_run ${OCF_RESKEY_binary} -G $OCF_RESKEY_group -U
$OCF_RESKEY_user \
-C $OCF_RESKEY_config \
$OCF_RESKEY_additional_parameters \
$asterisk_extra_params

if [ $? -ne 0 ]; then
ocf_log err "Asterisk PBX start command failed: $?"
return $?
fi

You need to:

rc=$?
if [ $rc -ne 0 ]; then
ocf_log err "Asterisk PBX start command failed: $rc"
return $OCF_ERR_GENERIC
fi

[...]
> > Should check content of $pid before line 377 in stop.
> 
> I'm unsure what you're suggesting here.
> 
> - Just check that the pid file is non-empty?
> - Check whether its contents are numeric?

Both? Perhaps it's not necessary though, depending on the
outcome of _status. But perhaps still better not to assume, but
check anyway. Perhaps we need a helper function for this in
ocf-shellfuncs, sth like ocf_is_pidfile_valid.

> - Read the pid and do a kill -0 before kill -TERM?

No :) I think that would be an overkill.

Cheers,

Dejan

> Cheers,
> Florian
> 
> -- 
> Need help with High Availability?
> http://www.hastexo.com/now
> ___
> 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/


Re: [Linux-ha-dev] [Linux-HA] [RfC] Review request for ocf:heartbeat:asterisk (Asterisk OCF RA)

2011-11-10 Thread Lars Ellenberg
On Thu, Nov 10, 2011 at 04:11:16PM +0100, Florian Haas wrote:
> Hi Dejan,
> 
> thanks for the feedback! We've worked in most of your suggested changes,
> see below:

> > More direct would be:
> > 
> > if [ $? -ne 0 ]; then

 $? in a test is almost always an error.
 Because you lose the actual value it had.
 So rather ex=$?, [ $ex ... ], and add $ex to the log message.

 Yo have that error also later in "Asterisk start command failed: $?",
 that will always log 0.

compare the output of the next two lines.
 ( (exit 7); if [ $? -ne 0 ]; then echo "ALWAYS 0!! exit code: $?"; fi )
 ( (exit 7); ex=$?; if [ $ex -ne 0 ]; then echo "exit code: $ex"; fi )

Btw,
 "User $OCF_RESKEY_user doesn't exit"
 there is an s missing.


-- 
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
___
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] [Linux-HA] [RfC] Review request for ocf:heartbeat:asterisk (Asterisk OCF RA)

2011-11-10 Thread Florian Haas
Hi Dejan,

thanks for the feedback! We've worked in most of your suggested changes,
see below:

On 2011-11-10 13:14, Dejan Muhamedagic wrote:
> Hi,
> 
> On Thu, Nov 10, 2011 at 10:27:36AM +0100, Florian Haas wrote:
>> On 2011-11-09 12:02, Martin Gerhard Loschwitz wrote:
>>> Hello everybody,
>>>
>>> I wrote an asterisk OCF resource agent which I am hereby putting up
>>> for discussion. Any feedback is welcome.
>>>
>>> It's available from
>>> https://github.com/fghaas/resource-agents/blob/master/heartbeat/asterisk
>>
>> Let's move this thread to the -dev list where it really belongs.
>>
>> FWIW, I consider this RA in pretty good shape -- I did review it rather
>> thoroughly and sent a few patches, for which Martin was kind enough to
>> include me, undeservingly, in the authors list. Feedback from others
>> would still be very much appreciated (even if it's just a "+1 for
>> merge"). Thanks!
> 
> Just a few remarks:
> 
> Ending commands with ';' is not necessary:
> 
>   return $OCF_ERR_INSTALLED;
> 
> i.e. ';' serves as a command separator. (:%s/;$//)

https://github.com/fghaas/resource-agents/commit/088ba39b855d4ca6375a17500aa0c0e1a2578db8#heartbeat/asterisk

> This construct looks a bit unusual:
> 
> if [ ! $? -eq 0 ]; then
> 
> More direct would be:
> 
> if [ $? -ne 0 ]; then

https://github.com/fghaas/resource-agents/commit/bbe7a0ba38d366b25067b09141208087a9e44850#heartbeat/asterisk

> Is this necessary (in asterisk_status):
> 
>   if [ -d /proc -a -d /proc/1 ]; then
>   [ "u$pid" != "u" -a -d /proc/$pid ]
>   else
>   ocf_run kill -s 0 $pid
>   fi
> 
> Why not just:
> 
>   kill -s 0 $pid

https://github.com/fghaas/resource-agents/commit/d77afe185d9cec53388c2248ce3b290f95e4cad5

> Line 273 in monitor is going to produce a lot of logging, better
> reduce severity to debug:
> 
>   ocf_log info "Asterisk PBX monitor succeeded";

https://github.com/fghaas/resource-agents/commit/cf130ce1a3d1b9502ad07df6361f611a256ee560#heartbeat/asterisk

> In asterisk_start() $ASTRUNDIR is first created using install(8),
> then again checked in lines 292-296 and created using mkdir,
> chown, etc. Superfluous.
>
> Start may exit with some arbitrary error code (line 324 in
> asterisk_start()).
> 
> Perhaps to move all local statements to the top of the function
> in asterisk_start().
> 
> [nitpicking] start_wait is not needed, why not just
> 
>   [ $rc -eq $OCF_SUCCESS ] && break

https://github.com/fghaas/resource-agents/commit/80ea432336a56cf2680f30c389b06c20f43eef79#heartbeat/asterisk

> Should check content of $pid before line 377 in stop.

I'm unsure what you're suggesting here.

- Just check that the pid file is non-empty?
- Check whether its contents are numeric?
- Read the pid and do a kill -0 before kill -TERM?

Cheers,
Florian

-- 
Need help with High Availability?
http://www.hastexo.com/now
___
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] change of process check in tomcat-ra

2011-11-10 Thread Dejan Muhamedagic
On Fri, Nov 04, 2011 at 01:55:57PM +0900, nozawat wrote:
> Hi Dejan
> 
> > Are we sure that the pid file is _always_ going to exist and
> > contain the PID?
> I believe that PID file exists, and I include pid.
> BTW, it is the next sentence to be important by this change.
> 
> > What's wrong with setting the tomcat_name parameter when it's really
> > needed (i.e. it is different from the default "tomcat")?
> For example, it may not move when CATALINA_OPTS is catalina.sh and is
> overwritten.
> It is to move without a problem even if an environment variable is set
> from the outside that I need.

I'm sorry, but I don't understand much of this. Could you please
rephrase. "may not move", what may (not) move? What is
overwritten? Which environment variable do you refer to?

Cheers,

Dejan

> Regards,
> Tomo
> 
> 2011/11/4 Dejan Muhamedagic :
> > Hi,
> >
> > On Tue, Nov 01, 2011 at 09:31:10AM +0900, nozawat wrote:
> >> Hi Dejan
> >>
> >>  Sorry,I got a wrong attached file.
> >>  I send a right file.
> >
> > Are we sure that the pid file is _always_ going to exist and
> > contain the PID? What's wrong with setting the tomcat_name
> > parameter when it's really needed (i.e. it is different from the
> > default "tomcat")?
> >
> > If you don't produce good arguments, this change looks
> > superfluous to me.
> >
> > Cheers,
> >
> > Dejan
> >
> >> Regards,
> >> Tomo
> >>
> >> 2011/11/1 Dejan Muhamedagic :
> >> > Hi,
> >> >
> >> > On Thu, Oct 27, 2011 at 11:36:10AM +0900, nozawat wrote:
> >> >> Hi
> >> >>
> >> >>  I changed the method of the process check in tomcat-ra.
> >> >>  SEARCH_STR does not function when I set tomcat parameter in 
> >> >> catalina.sh.
> >> >
> >> > This is the same one like the other to remove the pid file.
> >> > Wrong patch attached?
> >> >
> >> > Thanks,
> >> >
> >> > Dejan
> >> >
> >> >> Regards,
> >> >> Tomo
> >> >
> >> >
> >> >> ___
> >> >> 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/
> >> >
> >
> >
> >> ___
> >> 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/
> >
> ___
> 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/


Re: [Linux-ha-dev] Patch: iscsi RA

2011-11-10 Thread Dejan Muhamedagic
Hi,

On Thu, Nov 10, 2011 at 10:11:30AM +, Matthew Richardson wrote:
> In newer versions of iscsid (RHEL6) the init.d script has been changed,
> such that the start method won't do anything unless discovery etc has
> already occurred at least once.
> 
> As a result, there's now a new option in iscsid.conf - 'iscsid.startup'
> which you can set to be a command to be run when iscsiadm is unable to
> connect to the iscsid daemon:
> 
> http://groups.google.com/group/open-iscsi/browse_thread/thread/afdaaedad9050da8

Interesting. Some people are bored.

> The iscsi RA shouldn't fail if it notices iscsid isn't running if this
> value is set - this patch checks the config file to see if it exists,
> and if it does, doesn't return an error.

OK. If that doesn't help, it's going to fail later anyway.

> One side-effect of this change in behaviour is that this startup will
> only be carried out for certain iscsiadm actions.  Since (in RH anyway)
> the init.d script also loads the iscsi kernel modules, some actions in
> the RA will now fail if these modules haven't been loaded.

I'm not sure I understand this. How would it work without the RA?
Do people still need to invoke again /etc/init.d/iscsi start?
Aren't modules loaded anyway on start? If not, what loads them
later?

Did you already try this patch?

> The solution seems to be to 'manually' load the modules (e.g. via
> /etc/modprobe.d).  I'm not sure if this will have HA effects, since this
> will be a 'one-off' operation, e.g at boot.
> 
> Please let me know if you have any comments/suggestions on this patch,
> or think that a different approach to starting the iscsid daemon from
> the RA is now needed.

I'm not sure really.

Cheers,

Dejan

> Thanks,
> 
> Matthew
> 
> 
> 
> -- 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.

> --- iscsi 2011-06-29 13:51:48.0 +0100
> +++ iscsi.new 2011-11-10 09:52:13.0 +
> @@ -160,6 +160,8 @@
>  open_iscsi_daemon() {
>   if ps -e -o cmd | grep -qs '[i]scsid'; then
>   return 0
> +elif grep -qs '^iscsid.startup' /etc/iscsi/iscsid.conf; then
> +return 0
>   else
>   ocf_log err "iscsid not running; please start open-iscsi 
> utilities"
>   return 1
> 




> ___
> 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/


Re: [Linux-ha-dev] [Linux-HA] [RfC] Review request for ocf:heartbeat:asterisk (Asterisk OCF RA)

2011-11-10 Thread Dejan Muhamedagic
Hi,

On Thu, Nov 10, 2011 at 10:27:36AM +0100, Florian Haas wrote:
> On 2011-11-09 12:02, Martin Gerhard Loschwitz wrote:
> > Hello everybody,
> > 
> > I wrote an asterisk OCF resource agent which I am hereby putting up
> > for discussion. Any feedback is welcome.
> > 
> > It's available from
> > https://github.com/fghaas/resource-agents/blob/master/heartbeat/asterisk
> 
> Let's move this thread to the -dev list where it really belongs.
> 
> FWIW, I consider this RA in pretty good shape -- I did review it rather
> thoroughly and sent a few patches, for which Martin was kind enough to
> include me, undeservingly, in the authors list. Feedback from others
> would still be very much appreciated (even if it's just a "+1 for
> merge"). Thanks!

Just a few remarks:

Ending commands with ';' is not necessary:

return $OCF_ERR_INSTALLED;

i.e. ';' serves as a command separator. (:%s/;$//)

This construct looks a bit unusual:

if [ ! $? -eq 0 ]; then

More direct would be:

if [ $? -ne 0 ]; then

Is this necessary (in asterisk_status):

if [ -d /proc -a -d /proc/1 ]; then
[ "u$pid" != "u" -a -d /proc/$pid ]
else
ocf_run kill -s 0 $pid
fi

Why not just:

kill -s 0 $pid

Line 273 in monitor is going to produce a lot of logging, better
reduce severity to debug:

ocf_log info "Asterisk PBX monitor succeeded";

In asterisk_start() $ASTRUNDIR is first created using install(8),
then again checked in lines 292-296 and created using mkdir,
chown, etc. Superfluous.

Start may exit with some arbitrary error code (line 324 in
asterisk_start()).

Perhaps to move all local statements to the top of the function
in asterisk_start().

[nitpicking] start_wait is not needed, why not just

[ $rc -eq $OCF_SUCCESS ] && break

Should check content of $pid before line 377 in stop.

Thanks for great work!

Cheers,

Dejan

> Cheers,
> Florian
> 
> -- 
> Need help with High Availability?
> http://www.hastexo.com/now
> ___
> 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/


[Linux-ha-dev] Patch: iscsi RA

2011-11-10 Thread Matthew Richardson
In newer versions of iscsid (RHEL6) the init.d script has been changed,
such that the start method won't do anything unless discovery etc has
already occurred at least once.

As a result, there's now a new option in iscsid.conf - 'iscsid.startup'
which you can set to be a command to be run when iscsiadm is unable to
connect to the iscsid daemon:

http://groups.google.com/group/open-iscsi/browse_thread/thread/afdaaedad9050da8

The iscsi RA shouldn't fail if it notices iscsid isn't running if this
value is set - this patch checks the config file to see if it exists,
and if it does, doesn't return an error.

One side-effect of this change in behaviour is that this startup will
only be carried out for certain iscsiadm actions.  Since (in RH anyway)
the init.d script also loads the iscsi kernel modules, some actions in
the RA will now fail if these modules haven't been loaded.

The solution seems to be to 'manually' load the modules (e.g. via
/etc/modprobe.d).  I'm not sure if this will have HA effects, since this
will be a 'one-off' operation, e.g at boot.

Please let me know if you have any comments/suggestions on this patch,
or think that a different approach to starting the iscsid daemon from
the RA is now needed.

Thanks,

Matthew



-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.
--- iscsi	2011-06-29 13:51:48.0 +0100
+++ iscsi.new	2011-11-10 09:52:13.0 +
@@ -160,6 +160,8 @@
 open_iscsi_daemon() {
 	if ps -e -o cmd | grep -qs '[i]scsid'; then
 		return 0
+elif grep -qs '^iscsid.startup' /etc/iscsi/iscsid.conf; then
+return 0
 	else
 		ocf_log err "iscsid not running; please start open-iscsi utilities"
 		return 1



signature.asc
Description: OpenPGP digital signature
___
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] [Linux-HA] [RfC] Review request for ocf:heartbeat:asterisk (Asterisk OCF RA)

2011-11-10 Thread Florian Haas
On 2011-11-09 12:02, Martin Gerhard Loschwitz wrote:
> Hello everybody,
> 
> I wrote an asterisk OCF resource agent which I am hereby putting up
> for discussion. Any feedback is welcome.
> 
> It's available from
> https://github.com/fghaas/resource-agents/blob/master/heartbeat/asterisk

Let's move this thread to the -dev list where it really belongs.

FWIW, I consider this RA in pretty good shape -- I did review it rather
thoroughly and sent a few patches, for which Martin was kind enough to
include me, undeservingly, in the authors list. Feedback from others
would still be very much appreciated (even if it's just a "+1 for
merge"). Thanks!

Cheers,
Florian

-- 
Need help with High Availability?
http://www.hastexo.com/now
___
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/