On Wed, Mar 17, 2010 at 11:35 AM, Marian Marinov <[email protected]> wrote:
> On Wednesday 17 March 2010 12:16:58 Andreas Mock wrote:
>> Hi all,
>>
>> here some questions regarding programming ocf-ra:
>>
>> a) Am I right that programming a RA as portable shell script (no bashisms)
>>  is preferred? Or are other (scripting) languages also welcome?
> I'm confident that no bashisms are allowed... this made me rewrite a lot of
> things in the mysql RA. I don't think that other scripting languages are
> allowed, but maybe Dejan can answer better here.

Bashisms are allowed, _provided_ you require /bin/bash instead of /bin/sh
However, if something can be done without bash, its usually best to avoid it.

Also any language can be used for the agents, we even have ones in C.

>
>> b) I found RA scripts for daemons where the 'status' call checks for the
>>  existence of the daemon pid file and if that file is not there
>>  $OCF_NOT_RUNNING is returned.

Ideally it should also look for running processes.
But if its possible to have multiple copies of the process, it can be
non-trivial to match a running process to a particular cluster
resource.

>> As all the cluster guys out there should be
>>  very pessimistic by default, I'm asking myself if this kind of check is
>>  really enough. On the one hand side much efford is taken to be REALLY sure
>>  that a ressource isn't alive anymore (fencing, STONITH) and on the other
>>  side the simple nonexistence of a file seems to be enough to assume (!)
>>  the relevant process isn't alive anymore.
>>
>> What are you thinking about that?
>
> I don't really agree here. You are right that a missing pidfile is not enough.
> However, it is required that a service is started with the RA for it. And it
> is required that this RA or the Services handles the creation of the pidfile.
>
> The idea is that you are depending on the same RA to check and verify if the
> pidfile was created during the startup and this is way you depend on this pid
> file.
>
> If you don't start your service from the RA then it is your problem and not
> the RA.
>
> My point is that one should verify the pidfile after starting and do not mark
> as started/running a service with a wrong or missing pidfile. This way we will
> skip more useless checks.
>
> Best regards,
> Marian
>
>> c) If you agree with me, that a explicit check for a running process would
>>  be more reliable, my next question is: Does anyone know how this can be
>>  done in a shell script in a portable and reliable manner? (e.g. ps ax with
>>  grep)
>>
>> I found that 'ocf_pidfile_status' in .ocf-shellfuncs encapsulates a part of
>>  the required tests.
>>
>> Awaiting your comments and suggestions?
>>
>> Best regards
>> Andreas Mock
>> _______________________________________________
>> Linux-HA mailing list
>> [email protected]
>> http://lists.linux-ha.org/mailman/listinfo/linux-ha
>> See also: http://linux-ha.org/ReportingProblems
>>
>
> --
> Best regards,
> Marian Marinov
>
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
>
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to