Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux-HA: Dev

[PATCH] pgsql RA: Replace echo command with ocf_log

 

 

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded


nakahira at intellilink

Jan 12, 2010, 6:39 PM

Post #1 of 3 (874 views)
Permalink
[PATCH] pgsql RA: Replace echo command with ocf_log

Hi, all

I replace echo command with ocf_log in the pgsql RA
because echo command output in the monitor function
was not recorded in the ha-log and ha-debug.

It is a cause that log-level of the echo command output
in the monitor function is set to debug2.

Moreover, echo command in the start/stop functions are
replaced by ocf_log to unify the logging methods.

Best Regards,
NAKAHIRA Kazutomo

--
----------------------------------------
NAKAHIRA Kazutomo
NTT DATA INTELLILINK CORPORATION
Open Source Business Unit
Software Services Integration Business Division
Attachments: pgsql.patch (1.43 KB)


dejanmm at fastmail

Jan 13, 2010, 2:13 AM

Post #2 of 3 (814 views)
Permalink
Re: [PATCH] pgsql RA: Replace echo command with ocf_log [In reply to]

Hi Kazutomo-san,

On Wed, Jan 13, 2010 at 11:39:57AM +0900, NAKAHIRA Kazutomo wrote:
> Hi, all
>
> I replace echo command with ocf_log in the pgsql RA
> because echo command output in the monitor function
> was not recorded in the ha-log and ha-debug.
>
> It is a cause that log-level of the echo command output
> in the monitor function is set to debug2.

Which log-level is that? echo can't have log-level.

> Moreover, echo command in the start/stop functions are
> replaced by ocf_log to unify the logging methods.

When run from lrmd, i.e. in normal cluster operation, all
stdout/stderr output is logged, so sending output to stdout
shouldn't be a problem.

Cheers,

Dejan

> Best Regards,
> NAKAHIRA Kazutomo
>
> --
> ----------------------------------------
> NAKAHIRA Kazutomo
> NTT DATA INTELLILINK CORPORATION
> Open Source Business Unit
> Software Services Integration Business Division

> # HG changeset patch
> # User root [at] prec370
> # Date 1263272496 -32400
> # Node ID c425c16744c72729eac03a571e408ed14a15016b
> # Parent c76b4a6eb576feb3b39852aa2349a0716bda1078
> pgsql: An echo command is replaced with ocf_log command.
>
> diff -r c76b4a6eb576 -r c425c16744c7 heartbeat/pgsql
> --- a/heartbeat/pgsql Mon Jan 04 14:42:10 2010 +0100
> +++ b/heartbeat/pgsql Tue Jan 12 14:01:36 2010 +0900
> @@ -209,7 +209,7 @@ pgsql_start() {
> ocf_log info "PostgreSQL start command sent."
> else
> ocf_log err "Can't start PostgreSQL."
> - echo "$output"
> + ocf_log info "psql command output: $output"
> return $OCF_ERR_GENERIC
> fi
> else
> @@ -260,9 +260,9 @@ pgsql_stop() {
> then
> #PostgreSQL is still up. Use another shutdown mode.
> ocf_log info "PostgreSQL failed to stop after ${OCF_RESKEY_stop_escalate}s using -m fast. Trying -m immediate..."
> - echo "$output"
> + ocf_log info "psql command output: $output"
> output=`runasowner "$OCF_RESKEY_pgctl -D $OCF_RESKEY_pgdata stop -m immediate" 2>&1`
> - echo "$output"
> + ocf_log info "psql command output: $output"
> fi
>
> while :
> @@ -334,7 +334,7 @@ pgsql_monitor() {
> then
> ocf_log err "Script error(the variable ON_ERROR_STOP was set) occurred while executing the psql command."
> fi
> - echo "$output"
> + ocf_log info "psql command output: $output"
> return $OCF_ERR_GENERIC
> fi
>

> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


sergeyfd at gmail

Jan 13, 2010, 1:09 PM

Post #3 of 3 (813 views)
Permalink
Re: [PATCH] pgsql RA: Replace echo command with ocf_log [In reply to]

On Wed, Jan 13, 2010 at 3:13 AM, Dejan Muhamedagic <dejanmm [at] fastmail> wrote:
> Hi Kazutomo-san,
>
> On Wed, Jan 13, 2010 at 11:39:57AM +0900, NAKAHIRA Kazutomo wrote:
>> Hi, all
>>
>> I replace echo command with ocf_log in the pgsql RA
>> because echo command output in the monitor function
>> was not recorded in the ha-log and ha-debug.
>>
>> It is a cause that log-level of the echo command output
>> in the monitor function is set to debug2.
>
> Which log-level is that? echo can't have log-level.
>
>> Moreover, echo command in the start/stop functions are
>> replaced by ocf_log to unify the logging methods.
>
> When run from lrmd, i.e. in normal cluster operation, all
> stdout/stderr output is logged, so sending output to stdout
> shouldn't be a problem.
>
> Cheers,
>
> Dejan
>

You are absolutely right here and results of those echo commands are
logged in, at least in my configuration. But this patch makes sense
anyway since it unifies output methods. So please apply it if you
don't have any arguments against it.

Thanks.


--
Serge Dubrouski.
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Linux-HA dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.