Mailing List Archive

[Patch]The patch which revises log and an unnecessary loop for postfix resource agent.
Hi Raoul,
Hi All,

I send the modified patch of the resource agent of postfix.

The correction is two points.

* Change of the log level in conjunction with the monitor processing.
* Deletion of an unnecessary loop by the stop processing

Please please confirm my correction.
And please commit a correction.

Best Regards,
Hideo Yamauchi.
Re: [Patch]The patch which revises log and an unnecessary loop for postfix resource agent. [ In reply to ]
Hi All,

Sorry....
Because there was an error to the patch, I send it again.

Best Regards,
Hideo Yamauchi.

--- On Mon, 2011/11/14, renayama19661014@ybb.ne.jp <renayama19661014@ybb.ne.jp> wrote:

> Hi Raoul,
> Hi All,
>
> I send the modified patch of the resource agent of postfix.
>
> The correction is two points.
>
> * Change of the log level in conjunction with the monitor processing.
> * Deletion of an unnecessary loop by the stop processing
>
> Please please confirm my correction.
> And please commit a correction.
>
> Best Regards,
> Hideo Yamauchi.
Re: [Patch]The patch which revises log and an unnecessary loop for postfix resource agent. [ In reply to ]
hi!

thanks for your contribution!

On 2011-11-14 07:04, renayama19661014@ybb.ne.jp wrote:
> diff -r 52dcb4318e21 heartbeat/postfix
> --- a/heartbeat/postfix Mon Nov 14 14:46:36 2011 +0900
> +++ b/heartbeat/postfix Mon Nov 14 14:47:03 2011 +0900
...
> @@ -168,14 +171,17 @@
>
> # grant some time for shutdown and recheck 5 times
> for i in 1 2 3 4 5; do
> - if postfix_running; then
> + if postfix_running info; then
> sleep 1
> + else
> + ocf_log info "Postfix stopped."
> + return $OCF_SUCCESS
> fi
> done
why do you want to return here and not simply break and let the
postfix_stop() continue it's work?


besides that, your patch looks fine upon the first check.

cheers,
raoul
--
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc. email. r.bhatia@ipax.at
Technischer Leiter

IPAX - Aloy Bhatia Hava OG web. http://www.ipax.at
Barawitzkagasse 10/2/2/11 email. office@ipax.at
1190 Wien tel. +43 1 3670030
FN 277995t HG Wien fax. +43 1 3670030 15
____________________________________________________________________
_______________________________________________________
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]The patch which revises log and an unnecessary loop for postfix resource agent. [ In reply to ]
Hi Raoul,

> why do you want to return here and not simply break and let the
> postfix_stop() continue it's work?

No, I do not have any problem even if I use the break sentence.
It is my preference to have used the return sentence.

Cheers,
Hideo Yamauchi.


--- On Mon, 2011/11/14, Raoul Bhatia [IPAX] <r.bhatia@ipax.at> wrote:

> hi!
>
> thanks for your contribution!
>
> On 2011-11-14 07:04, renayama19661014@ybb.ne.jp wrote:
> > diff -r 52dcb4318e21 heartbeat/postfix
> > --- a/heartbeat/postfix    Mon Nov 14 14:46:36 2011 +0900
> > +++ b/heartbeat/postfix    Mon Nov 14 14:47:03 2011 +0900
> ...
> > @@ -168,14 +171,17 @@
> >
> >      # grant some time for shutdown and recheck 5 times
> >      for i in 1 2 3 4 5; do
> > -        if postfix_running; then
> > +        if postfix_running info; then
> >              sleep 1
> > +        else
> > +            ocf_log info "Postfix stopped."
> > +            return $OCF_SUCCESS
> >          fi
> >      done
> why do you want to return here and not simply break and let the
> postfix_stop() continue it's work?
>
>
> besides that, your patch looks fine upon the first check.
>
> cheers,
> raoul
> --
> ____________________________________________________________________
> DI (FH) Raoul Bhatia M.Sc.          email.          r.bhatia@ipax.at
> Technischer Leiter
>
> IPAX - Aloy Bhatia Hava OG          web.          http://www.ipax.at
> Barawitzkagasse 10/2/2/11           email.            office@ipax.at
> 1190 Wien                           tel.               +43 1 3670030
> FN 277995t HG Wien                  fax.            +43 1 3670030 15
> ____________________________________________________________________
>
_______________________________________________________
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]The patch which revises log and an unnecessary loop for postfix resource agent. [ In reply to ]
hi Hideo-san!

On 2011-11-15 01:14, renayama19661014@ybb.ne.jp wrote:
> Hi Raoul,
>
>> why do you want to return here and not simply break and let the
>> postfix_stop() continue it's work?

ok, so i would change the patch to:

> --- a/heartbeat/postfix
> +++ b/heartbeat/postfix
> @@ -173,6 +173,8 @@ postfix_stop()
> for i in 1 2 3 4 5; do
> if postfix_running info; then
> sleep 1
> + else
> + break
> fi
> done

1. simply break the loop when postfix isn't running anymore.
2. ocf_log info "Postfix stopped." will be called at the end of the
postfix_stop() method.

any objections?

thanks,
raoul
--
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc. email. r.bhatia@ipax.at
Technischer Leiter

IPAX - Aloy Bhatia Hava OG web. http://www.ipax.at
Barawitzkagasse 10/2/2/11 email. office@ipax.at
1190 Wien tel. +43 1 3670030
FN 277995t HG Wien fax. +43 1 3670030 15
____________________________________________________________________
_______________________________________________________
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]The patch which revises log and an unnecessary loop for postfix resource agent. [ In reply to ]
Hi Raoul,

Thank you for comment.

> 1. simply break the loop when postfix isn't running anymore.
> 2. ocf_log info "Postfix stopped." will be called at the end of the
> postfix_stop() method.
>
> any objections?

All right.

I think that the correction that you suggested is right.
I approve of it.

Thanks,
Hideo Yamauchi.

--- On Tue, 2011/11/15, Raoul Bhatia [IPAX] <r.bhatia@ipax.at> wrote:

> hi Hideo-san!
>
> On 2011-11-15 01:14, renayama19661014@ybb.ne.jp wrote:
> > Hi Raoul,
> >
> >> why do you want to return here and not simply break and let the
> >> postfix_stop() continue it's work?
>
> ok, so i would change the patch to:
>
> > --- a/heartbeat/postfix
> > +++ b/heartbeat/postfix
> > @@ -173,6 +173,8 @@ postfix_stop()
> >      for i in 1 2 3 4 5; do
> >          if postfix_running info; then
> >              sleep 1
> > +        else
> > +            break
> >          fi
> >      done
>
> 1. simply break the loop when postfix isn't running anymore.
> 2. ocf_log info "Postfix stopped." will be called at the end of the
>    postfix_stop() method.
>
> any objections?
>
> thanks,
> raoul
> -- ____________________________________________________________________
> DI (FH) Raoul Bhatia M.Sc.          email.          r.bhatia@ipax.at
> Technischer Leiter
>
> IPAX - Aloy Bhatia Hava OG          web.          http://www.ipax.at
> Barawitzkagasse 10/2/2/11           email.            office@ipax.at
> 1190 Wien                           tel.               +43 1 3670030
> FN 277995t HG Wien                  fax.            +43 1 3670030 15
> ____________________________________________________________________
>
_______________________________________________________
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]The patch which revises log and an unnecessary loop for postfix resource agent. [ In reply to ]
On 2011-11-15 10:10, renayama19661014@ybb.ne.jp wrote:
> I think that the correction that you suggested is right.
> I approve of it.

thanks.

i just pushed it to my resource-agents branch [1][2]
i will look at your patch regarding the data_directory soon.

thank you for your contribution!
raoul
[1] https://github.com/raoulbhatia/resource-agents/tree/postfix
[2] https://github.com/raoulbhatia/resource-agents/commits/postfix
--
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc. email. r.bhatia@ipax.at
Technischer Leiter

IPAX - Aloy Bhatia Hava OG web. http://www.ipax.at
Barawitzkagasse 10/2/2/11 email. office@ipax.at
1190 Wien tel. +43 1 3670030
FN 277995t HG Wien fax. +43 1 3670030 15
____________________________________________________________________
_______________________________________________________
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]The patch which revises log and an unnecessary loop for postfix resource agent. [ In reply to ]
On 2011-11-15 10:19, Raoul Bhatia [IPAX] wrote:
> On 2011-11-15 10:10, renayama19661014@ybb.ne.jp wrote:
>> I think that the correction that you suggested is right.
>> I approve of it.
>
> thanks.
>
> i just pushed it to my resource-agents branch [1][2]
> i will look at your patch regarding the data_directory soon.
>
> thank you for your contribution!
> raoul

i forgot to add the break inside the loop.
the fix has been applied and has been pushed to my repo [1][2]


there is one thing i noticed though, which i think kind of
suboptimal:

upon starting, we log the following:

> Nov 18 15:01:14 m01 crmd: [2063]: info: do_lrm_rsc_op: Performing key=114:55889:0:9582c8d2-c69a-4d79-91f6-04ea7bbe1853 op=m-mail-postfix_start_0 )
> Nov 18 15:01:14 m01 lrmd: [2060]: info: rsc:m-mail-postfix start[176] (pid 12172)
> Nov 18 15:01:14 m01 postfix/postfix-script[12326]: the Postfix mail system is not running
> Nov 18 15:01:14 m01 postfix[12172]: INFO: Postfix status: ''. 1
> Nov 18 15:01:14 m01 postfix/postfix-script[12475]: starting the Postfix mail system
> Nov 18 15:01:14 m01 postfix/master[12476]: daemon started -- version 2.8.3, configuration /data/mail/conf
> Nov 18 15:01:15 m01 postfix/postfix-script[12804]: the Postfix mail system is running: PID: 12476
> Nov 18 15:01:15 m01 postfix[12172]: INFO: Postfix started.

there is one line that i would like to do something about:

> Nov 18 15:01:14 m01 postfix[12172]: INFO: Postfix status: ''. 1

1. we do not capture the "the Postfix mail system is not running"
output. maybe this is a result from running in an interactive shell?

2. we log an error (rc 1) which actually is expected and good
(postfix is not running; we're eligible to start it)

the same happens upon stopping postfix:
> Nov 18 15:01:07 m01 crmd: [2063]: info: do_lrm_rsc_op: Performing key=116:55885:0:9582c8d2-c69a-4d79-91f6-04ea7bbe1853 op=m-mail-postfix_stop_0 )
> Nov 18 15:01:07 m01 lrmd: [2060]: info: rsc:m-mail-postfix stop[175] (pid 10420)
> Nov 18 15:01:08 m01 postfix/postfix-script[10632]: the Postfix mail system is not running
> Nov 18 15:01:08 m01 postfix[10420]: INFO: Postfix status: ''. 1
> Nov 18 15:01:08 m01 postfix/postfix-script[10652]: the Postfix mail system is not running
> Nov 18 15:01:08 m01 postfix[10420]: INFO: Postfix status: ''. 1
> Nov 18 15:01:08 m01 postfix[10420]: INFO: Postfix stopped.
> Nov 18 15:01:08 m01 lrmd: [2060]: info: operation stop[175] on m-mail-postfix for client 2063: pid 10420 exited with return code 0


do you have any ideas?
do you see the same output?

on my test system, i'm running postfix 2.8.3.

cheers,
raoul
[1] https://github.com/raoulbhatia/resource-agents/tree/postfix
[2] https://github.com/raoulbhatia/resource-agents/commits/postfix
--
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc. email. r.bhatia@ipax.at
Technischer Leiter

IPAX - Aloy Bhatia Hava OG web. http://www.ipax.at
Barawitzkagasse 10/2/2/11 email. office@ipax.at
1190 Wien tel. +43 1 3670030
FN 277995t HG Wien fax. +43 1 3670030 15
____________________________________________________________________
_______________________________________________________
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/