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

Mailing List Archive: Linux-HA: Dev

Repost of postfix ocf ra

 

 

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


r.bhatia at ipax

Jul 27, 2009, 5:46 AM

Post #1 of 5 (1347 views)
Permalink
Repost of postfix ocf ra

hi,

i'm reposting the postfix ocf ra as i feel that my works are complete.

dejan posted some comments in his last email which i will address:

>> i'm now checking more indepth for:
>> > 1. empty queue_directory
>
> For monitor? Why?

because then something is broken. i reworked this part now
and am checking if the directory exists, "[ -d ... ]" return <> 0, at
least on my linux box using bash.

>> 2. pidfile
>> 3. "postfix status"
>> 4. postqueue ... | grep 'Mail system is down'
>> 5. fuser -v $queue
>>
>> is this ok? feel free to remove some checks
>
> It should be enough just to check for the process. First using
> pidfile and if that doesn't work then with fuser.

i do not know enough about fuser to know if this is available on all
systems. after going through all comments i received, especially the
ones from lars ellenberg, i compiled this set of checks.

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

IPAX - Aloy Bhatia Hava OEG web. http://www.ipax.at
Barawitzkagasse 10/2/2/11 email. office [at] ipax
1190 Wien tel. +43 1 3670030
FN 277995t HG Wien fax. +43 1 3670030 15
____________________________________________________________________
Attachments: postfix (9.29 KB)


r.bhatia at ipax

Aug 11, 2009, 4:55 AM

Post #2 of 5 (1168 views)
Permalink
Re: Repost of postfix ocf ra [In reply to]

*bump*

On 07/27/2009 02:46 PM, Raoul Bhatia [IPAX] wrote:
> hi,
>
> i'm reposting the postfix ocf ra as i feel that my works are complete.
>
> dejan posted some comments in his last email which i will address:
>
>>> i'm now checking more indepth for:
>>>> 1. empty queue_directory
>>
>> For monitor? Why?
>
> because then something is broken. i reworked this part now
> and am checking if the directory exists, "[ -d ... ]" return <> 0, at
> least on my linux box using bash.
>
>>> 2. pidfile
>>> 3. "postfix status"
>>> 4. postqueue ... | grep 'Mail system is down'
>>> 5. fuser -v $queue
>>>
>>> is this ok? feel free to remove some checks
>>
>> It should be enough just to check for the process. First using
>> pidfile and if that doesn't work then with fuser.
>
> i do not know enough about fuser to know if this is available on all
> systems. after going through all comments i received, especially the
> ones from lars ellenberg, i compiled this set of checks.
>
> cheers,
> raoul
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________________
> Linux-HA-Dev: Linux-HA-Dev [at] lists
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/


--
____________________________________________________________________
DI (FH) Raoul Bhatia M.Sc. email. r.bhatia [at] ipax
Technischer Leiter

IPAX - Aloy Bhatia Hava OEG web. http://www.ipax.at
Barawitzkagasse 10/2/2/11 email. office [at] ipax
1190 Wien tel. +43 1 3670030
FN 277995t HG Wien fax. +43 1 3670030 15
____________________________________________________________________
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Aug 12, 2009, 8:32 AM

Post #3 of 5 (1161 views)
Permalink
Re: Repost of postfix ocf ra [In reply to]

Hi Raoul,

On Mon, Jul 27, 2009 at 02:46:14PM +0200, Raoul Bhatia [IPAX] wrote:
> hi,
>
> i'm reposting the postfix ocf ra as i feel that my works are complete.
>
> dejan posted some comments in his last email which i will address:
>
> >> i'm now checking more indepth for:
> >> > 1. empty queue_directory
> >
> > For monitor? Why?
>
> because then something is broken. i reworked this part now
> and am checking if the directory exists, "[ -d ... ]" return <> 0, at
> least on my linux box using bash.

This is from a diff:

+ [ -d "$queue" ] || return 1 # check if queue directory is empty @TODO shall we return false or $OCF_ERR_something

I guess you meant to say: "check if queue is a directory"?

> >> 2. pidfile
> >> 3. "postfix status"
> >> 4. postqueue ... | grep 'Mail system is down'
> >> 5. fuser -v $queue
> >>
> >> is this ok? feel free to remove some checks
> >
> > It should be enough just to check for the process. First using
> > pidfile and if that doesn't work then with fuser.
>
> i do not know enough about fuser to know if this is available on all
> systems. after going through all comments i received, especially the
> ones from lars ellenberg, i compiled this set of checks.

This got too complicated. Again, part of the diff:

+ # try some different methods to see if we can find a running postfix/master instance
+ # postfix status
+ $binary $OPTION_CONFIG_DIR status >/dev/null 2>&1 && return $OCF_SUCCESS

Shouldn't this be enough? Is there a chance that "postfix status"
would lie? If not, then you wouldn't even need to fiddle with the
pid file. And it seems to me preferable to leave this to the
postfix itself: it should really know the best.

No need to repost the whole script again, I already edited it to
fix some false false(1) usage and reduce some noise :) (note that
false doesn't change the order of execution just exits with code 1).

Cheers,

Dejan

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


r.bhatia at ipax

Aug 14, 2009, 2:49 AM

Post #4 of 5 (1142 views)
Permalink
Re: Repost of postfix ocf ra [In reply to]

On 12.08.2009 17:32, Dejan Muhamedagic wrote:
*snip*
>> because then something is broken. i reworked this part now
>> and am checking if the directory exists, "[ -d ... ]" return<> 0, at
>> least on my linux box using bash.
>
> This is from a diff:
>
> + [ -d "$queue" ] || return 1 # check if queue directory is empty @TODO shall we return false or $OCF_ERR_something
>
> I guess you meant to say: "check if queue is a directory"?

yes, i meant to say that :)

> This got too complicated. Again, part of the diff:
>
> + # try some different methods to see if we can find a running postfix/master instance
> + # postfix status
> + $binary $OPTION_CONFIG_DIR status>/dev/null 2>&1&& return $OCF_SUCCESS
>
> Shouldn't this be enough? Is there a chance that "postfix status"
> would lie? If not, then you wouldn't even need to fiddle with the
> pid file. And it seems to me preferable to leave this to the
> postfix itself: it should really know the best.

i'd say yes ;)

> No need to repost the whole script again, I already edited it to
> fix some false false(1) usage and reduce some noise :) (note that
> false doesn't change the order of execution just exits with code 1).

ok - i then can't wait for the commit ;)

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

IPAX - Aloy Bhatia Hava OEG web. http://www.ipax.at
Barawitzkagasse 10/2/2/11 email. office [at] ipax
1190 Wien tel. +43 1 3670030
FN 277995t HG Wien fax. +43 1 3670030 15
____________________________________________________________________
_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev [at] lists
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/


dejanmm at fastmail

Aug 14, 2009, 3:33 AM

Post #5 of 5 (1149 views)
Permalink
Re: Repost of postfix ocf ra [In reply to]

Hi,

On Fri, Aug 14, 2009 at 11:49:24AM +0200, Raoul Bhatia [IPAX] wrote:
> On 12.08.2009 17:32, Dejan Muhamedagic wrote:
> *snip*
> >> because then something is broken. i reworked this part now
> >> and am checking if the directory exists, "[ -d ... ]" return<> 0, at
> >> least on my linux box using bash.
> >
> > This is from a diff:
> >
> > + [ -d "$queue" ] || return 1 # check if queue directory is empty @TODO shall we return false or $OCF_ERR_something
> >
> > I guess you meant to say: "check if queue is a directory"?
>
> yes, i meant to say that :)
>
> > This got too complicated. Again, part of the diff:
> >
> > + # try some different methods to see if we can find a running postfix/master instance
> > + # postfix status
> > + $binary $OPTION_CONFIG_DIR status>/dev/null 2>&1&& return $OCF_SUCCESS
> >
> > Shouldn't this be enough? Is there a chance that "postfix status"
> > would lie? If not, then you wouldn't even need to fiddle with the
> > pid file. And it seems to me preferable to leave this to the
> > postfix itself: it should really know the best.
>
> i'd say yes ;)

OK. I reduced then the status function to postfix status.

> > No need to repost the whole script again, I already edited it to
> > fix some false false(1) usage and reduce some noise :) (note that
> > false doesn't change the order of execution just exits with code 1).
>
> ok - i then can't wait for the commit ;)

Committed.

Cheers,

Dejan

> cheers,
> raoul
> --
> ____________________________________________________________________
> DI (FH) Raoul Bhatia M.Sc. email. r.bhatia [at] ipax
> Technischer Leiter
>
> IPAX - Aloy Bhatia Hava OEG web. http://www.ipax.at
> Barawitzkagasse 10/2/2/11 email. office [at] ipax
> 1190 Wien tel. +43 1 3670030
> FN 277995t HG Wien fax. +43 1 3670030 15
> ____________________________________________________________________
> _______________________________________________________
> 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/

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.