[OCF] ocf-shellfuncs standardization - Comments? Objections?
Ragnar Kjørstad
linux-ha at ragnark.vestdata.no
Tue Jul 5 15:09:50 MDT 2005
On Mon, Jul 04, 2005 at 06:49:13PM -0600, Alan Robertson wrote:
> One of the nice things about the ocf_log functions as we have
> implemented them is that they work a lot more like syslog - they
> automatically include date/time/scriptname in the output.
But this is the implementation of the functions, not really dependent of
the interface of the functions.
> Do you know of a good way to implement what you've suggested? That is,
> to have them do whatever the local LSB implementation does when not
> invoked with OCF vars not set, and to have them do what the local OCF
> implementation wants, when they're invoked in the OCF environment. I
> guess I know of one way. Maybe you can suggest a better one?
>
> The way I know of is to have a dot-included file that redefines what
> those functions do, and then "dot-include" that file when in the OCF
> environment. That'd work. Not too elegant, but should be effective.
That's what I was thinking as well. Alternatively they could be seperate
scripts, and HA software should make sure their implementation of the
scripts were listed first in PATH. But since we would be dot-include OCF
stuff anyway.....
I'm mainly thinking about this from the concept of scripts that double
as both initscripts and OCF scripts. Then the script couldn't call
ocf specific logging functions, because it would they wouldn't be
defined when using it as a regular initscripts.
If, however, the HA software implemented the LSB logging functions, an
initscript that was written according to the LSB spec would
automatically get the OCF logging functionality. (Granted, most existing
initscripts actually do "echo" and don't use the LSB functions, but that
is just a bug).
Of course, even if we decide to use ocf specific logging functions it
would still be possible to write scripts that doubled, just a little bit
less convenient.
--
Ragnar Kjørstad
Software Engineer
Scali - http://www.scali.com
Scaling the Linux Datacenter
More information about the OCF
mailing list