Hi All,
I contribute my last patch.(patch3)
This is a patch for the sources which applied patch 1.
It is the patch which output the details of the error in log.
Best Regards,
Hideo Yamauchi.
--- On Tue, 2011/6/7, [email protected] <[email protected]>
wrote:
> Hi All,
>
> I revised the first patch.
> Please confirm contents.
>
> Best Regards,
> Hideo Yamauchi.
>
>
> --- On Tue, 2011/6/7, [email protected] <[email protected]>
> wrote:
>
> > Hi Raoul,
> >
> > Thank you for comment.
> >
> > > i think we could safely do the "kill -s 0" for *any*
> > > version and call "postfix status" only if available.
> >
> > I think so.
> >
> > However, I do not know a lot about postfix so.
> > I want the opinion of the detailed person.
> >
> > > btw. quickly looking at your patch, i spotted 1
> > > typo: "status_suuport" instead of "status_support"
> > > (douple u/p)
> >
> > Sorry...
> > It is my typo.
> >
> > > for the version check, i think we should try using the
> > > ocf internal function.
> >
> > Ok.
> >
> > >
> > > > * Change of the parameter check
> > > the checks are basically fine. i would slightly update the
> > > logging information. (i can do this when i apply your patches)
> >
> > Thanks!
> >
> > >
> > > > * Error log when status processing failed
> > > > * Value set of the ret variable
> > >
> > > i don't think that the use of $ret is correct.
> >
> > I made modifications to set unsettled ret variable in an original resource
> > agent.
> > But I am unsettled, the ret variable may not have to output it in log.
> >
> > Best Regards,
> > Hideo Yamauchi.
> >
> > --- On Mon, 2011/6/6, Raoul Bhatia [IPAX] <[email protected]> wrote:
> >
> > > Hi Hideo-san!
> > >
> > > On 06/06/2011 04:51 AM, [email protected] wrote:
> > > > Hi All,
> > > >
> > > > I send a patch in conjunction with the status processing.
> > > > It is made the following modifications.
> > > >
> > > > * Carry out status processing in a version judgment
> > >
> > > i think we could safely do the "kill -s 0" for *any*
> > > version and call "postfix status" only if available.
> > >
> > > btw. quickly looking at your patch, i spotted 1
> > > typo: "status_suuport" instead of "status_support"
> > > (douple u/p)
> > >
> > > for the version check, i think we should try using the
> > > ocf internal function.
> > >
> > > > * Change of the parameter check
> > > the checks are basically fine. i would slightly update the
> > > logging information. (i can do this when i apply your patches)
> > >
> > > > * Error log when status processing failed
> > > > * Value set of the ret variable
> > >
> > > i don't think that the use of $ret is correct.
> > >
> > > please comment on my suggestions and/or update the
> > > ra in this regard.
> > >
> > > thanks,
> > > raoul
> > > --
> > > ____________________________________________________________________
> > > DI (FH) Raoul Bhatia M.Sc. email. [email protected]
> > > Technischer Leiter
> > >
> > > IPAX - Aloy Bhatia Hava OG web. http://www.ipax.at
> > > Barawitzkagasse 10/2/2/11 email. [email protected]
> > > 1190 Wien tel. +43 1 3670030
> > > FN 277995t HG Wien fax. +43 1 3670030 15
> > > ____________________________________________________________________
> > >
> > _______________________________________________________
> > Linux-HA-Dev: [email protected]
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> > Home Page: http://linux-ha.org/
> >
diff -r 303d9d19eb61 postfix
--- a/postfix Tue Jun 07 11:22:15 2011 +0900
+++ b/postfix Tue Jun 07 11:35:52 2011 +0900
@@ -102,7 +102,7 @@
output=`$binary $OPTION_CONFIG_DIR status`
rcode=$?
if [ $rcode -ne 0 ]; then
- ocf_log err "Postfix status: $output"
+ ocf_log err "Postfix status: $rcode : $output"
fi
return $rcode
else
@@ -130,11 +130,11 @@
fi
# start Postfix
- $binary $OPTIONS start >/dev/null 2>&1
+ output=`$binary $OPTIONS start >/dev/null 2>&1`
ret=$?
if [ $ret -ne 0 ]; then
- ocf_log err "Postfix returned error." $ret
+ ocf_log err "Postfix returned error. $ret : $output"
return $OCF_ERR_GENERIC
fi
@@ -163,11 +163,11 @@
fi
# stop Postfix
- $binary $OPTIONS stop >/dev/null 2>&1
+ output=`$binary $OPTIONS stop >/dev/null 2>&1`
ret=$?
if [ $ret -ne 0 ]; then
- ocf_log err "Postfix returned an error while stopping." $ret
+ ocf_log err "Postfix returned an error while stopping. $ret : $output"
return $OCF_ERR_GENERIC
fi
@@ -201,7 +201,12 @@
{
if postfix_status; then
ocf_log info "Reloading Postfix."
- $binary $OPTIONS reload
+ output=`$binary $OPTIONS reload`
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ ocf_log err "Postfix reload error. $ret : $output"
+ fi
+ return $ret
fi
}
@@ -237,8 +242,9 @@
# check postfix version
status_support=false
output=`postconf $OPTION_CONFIG_DIR -h mail_version`
- if [ $? -ne 0 ]; then
- ocf_log err "Postfix config mail_version does not exist. $output"
+ ret=$?
+ if [ $ret -ne 0 ]; then
+ ocf_log err "Postfix config mail_version does not exist. $ret :
$output"
fi
ocf_version_cmp "$output" "2.5.0"
if [ $? -ne 0 ]; then
@@ -272,10 +278,10 @@
fi
# run Postfix internal check
- $binary $OPTIONS check >/dev/null 2>&1
+ output=`$binary $OPTIONS check >/dev/null 2>&1`
ret=$?
if [ $ret -ne 0 ]; then
- ocf_log err "Postfix 'check' failed." $ret
+ ocf_log err "Postfix 'check' failed. $ret : $output"
return $OCF_ERR_GENERIC
fi
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/