Mailing List Archive

[PATCH] nfsserver RA : add check statement to start function
Hi,

These are some small patches for nfsserver RA.

(1) nfsserver-validate-all.patch

nfsserver_validate() is called at line 254 and 263,
https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/nfsserver#L231

it means each operation(start/monitor/stop) calls nfsserver_validate() twice.
It's not harmfulness but just a little annoying.

I used mysql RA as a reference and modified the above.
https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql#L1059

(2) nfsserver-check-start.patch

If nfs service is already started befor RA's start,
https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/nfsserver#L172

fn=`mktemp`
${OCF_RESKEY_nfs_init_script} start > $fn 2>&1
rc=$?
ocf_log debug `cat $fn`
rm -f $fn

${OCF_RESKEY_nfs_init_script}, we call "/etc/init.d/nfs" in our case,
wouldn't print any stdout/stderr,
so "ocf_log debug" complains;
Not enough arguments [1] to ocf_log.

I added a check statement for this.
Please see the attached.

Regards,
Junko IKEDA

NTT DATA INTELLILINK CORPORATION
Re: [PATCH] nfsserver RA : add check statement to start function [ In reply to ]
Hi Junko-san,

On Wed, May 16, 2012 at 11:53:39AM +0900, Junko IKEDA wrote:
> Hi,
>
> These are some small patches for nfsserver RA.
>
> (1) nfsserver-validate-all.patch
>
> nfsserver_validate() is called at line 254 and 263,
> https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/nfsserver#L231
>
> it means each operation(start/monitor/stop) calls nfsserver_validate() twice.
> It's not harmfulness but just a little annoying.
>
> I used mysql RA as a reference and modified the above.
> https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/mysql#L1059

OK, applied.

> (2) nfsserver-check-start.patch
>
> If nfs service is already started befor RA's start,
> https://github.com/ClusterLabs/resource-agents/blob/master/heartbeat/nfsserver#L172

Applied too.

> fn=`mktemp`
> ${OCF_RESKEY_nfs_init_script} start > $fn 2>&1
> rc=$?
> ocf_log debug `cat $fn`
> rm -f $fn
>
> ${OCF_RESKEY_nfs_init_script}, we call "/etc/init.d/nfs" in our case,
> wouldn't print any stdout/stderr,
> so "ocf_log debug" complains;
> Not enough arguments [1] to ocf_log.
>
> I added a check statement for this.

This one seems to be missing. Or is it covered now by the monitor
test?

Cheers,

Dejan

> Please see the attached.
>
> Regards,
> Junko IKEDA
>
> NTT DATA INTELLILINK CORPORATION



> _______________________________________________________
> 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: [PATCH] nfsserver RA : add check statement to start function [ In reply to ]
Hi,

Thank you for your quick response!

> This one seems to be missing. Or is it covered now by the monitor
> test?

nfsserver_start () can now return $OCF_SUCCESS if it detects that nfs
server is already started.
This "ocf_log debug", which complains about the argument, will not be
called anymore because RA has already exited.

Thanks,
Junko
_______________________________________________________
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/