Hi Raoul,
Thank you for comment.
Because postfix check did not give back the details to a result as for RA, I
recognized that the details of the log were necessary.
I changed a check of data_directory.
And I abolish a suggestion street in front, the loop.
This is because the plural setting is not admitted because it added a check.
Please please confirm my correction.
And please commit a correction.
Best Regards,
Hideo Yamauchi.
--- On Sat, 2011/11/19, Raoul Bhatia [IPAX] <[email protected]> wrote:
> Hi Hideo-san!
>
> On 2011-11-16 11:36, [email protected] wrote:
> > I think that the same check has been already carried out in a resource
> > agent.
> >
> > (snip)
> > # run Postfix internal check, if not probing
> > if ! ocf_is_probe; then
> > $binary $OPTIONS check>/dev/null 2>&1
> > ret=$?
> > if [ $ret -ne 0 ]; then
> > ocf_log err "Postfix 'check' failed." $ret
> > return $OCF_ERR_GENERIC
> > fi
> > fi
> > (snip)
> >
> >
> > That means, after all is not the loop check of data_directory unnecessary?
>
> postfix check is called after all other checks have passed and, you're
> right, it also checks the required directories.
>
> i think i had some issues though:
> > # check spool/queue and data directories (if applicable)
> > # this is required because "postfix check" does not catch all errors
>
> but i cannot remember the exact problems anymore.
>
> anyways, postfix check will return a "OCF_ERR_GENERIC"
> which is regarded as a soft error (!) [1] and will
>
> a. not hint the user or a gui application to the exact problem and
> b. will lead to a restart of the failed resource on the same node
>
>
> the more in-depth check will fail with OCF_ERR_INSTALLED [2] or
> OCF_ERR_PERM [3] and will
>
> c. give more information in this regard and
> d. migrates the resource to a different node,
> which makes sense if i.e. the "shared" queue directory (nfs, etc.)
> isn't available.
>
>
> i think that this behavior is good and checking the most commonly
> modified directories separately has been very helpful in my setups.
>
> but of course, i'm open for comments.
>
> > #Sorry...Because English is weak, I may understand your opinion by mistake.
>
> no worries. english isn't my first language either and until now we
> managed to work things out, right? :)
>
> cheers,
> raoul
>
> [1]
> http://www.linux-ha.org/doc/dev-guides/_literal_ocf_err_generic_literal_1.html
> [2]
> http://www.linux-ha.org/doc/dev-guides/_literal_ocf_err_installed_literal_5.html
> [3]
> http://www.linux-ha.org/doc/dev-guides/_literal_ocf_err_perm_literal_4.html
> -- ____________________________________________________________________
> 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
> ____________________________________________________________________
>
diff -r aaf72a017c98 postfix
--- a/postfix Mon Nov 21 10:32:33 2011 +0900
+++ b/postfix Mon Nov 21 10:34:08 2011 +0900
@@ -264,7 +264,13 @@
fi
if ocf_is_true $status_support; then
- data_dir=`postconf $OPTION_CONFIG_DIR -h data_directory
2>/dev/null`
+ orig_data_dir=`postconf $OPTION_CONFIG_DIR -h data_directory
2>/dev/null`
+ data_dir=`echo $orig_data_dir | tr ',' ' '`
+ dcount=`echo $data_dir | wc -w`
+ if [ $dcount -gt 1 ]; then
+ ocf_log err "Postfix data directory '$orig_data_dir'
cannot set plural parameters."
+ return $OCF_ERR_PERM
+ fi
if [ ! -d "$data_dir" ]; then
if ocf_is_probe; then
ocf_log info "Postfix data directory '$data_dir' not
readable during probe."
@@ -278,16 +284,14 @@
# check directory permissions
if ocf_is_true $status_support; then
user=`postconf $OPTION_CONFIG_DIR -h mail_owner 2>/dev/null`
- for dir in "$data_dir"; do
- if ! su -s /bin/sh - $user -c "test -w $dir"; then
- if ocf_is_probe; then
- ocf_log info "Directory '$dir' is not writable by user
'$user' during probe."
- else
- ocf_log err "Directory '$dir' is not writable by user
'$user'."
- return $OCF_ERR_PERM;
- fi
+ if ! su -s /bin/sh - $user -c "test -w $data_dir"; then
+ if ocf_is_probe; then
+ ocf_log info "Directory '$data_dir' is not writable by
user '$user' during probe."
+ else
+ ocf_log err "Directory '$data_dir' is not writable by user
'$user'."
+ return $OCF_ERR_PERM;
fi
- done
+ fi
fi
fi
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/