[OCF] ocf-shellfuncs standardization - Comments? Objections?
Ragnar Kjørstad
linux-ha at ragnark.vestdata.no
Tue Aug 16 15:15:37 MDT 2005
On Tue, Aug 16, 2005 at 09:47:38AM -0700, Nick Stoughton wrote:
> I didn't say that *daemons* should write to standard output ... these
> are tools to use in a shell script. Almost all utilities write to
> standard output. I remain convinced that the log_xxx_message functions
> should write to standard output. This means that you, as a writer of the
> shell init script, know that you can do normal redirection things with
> this function. For example
> log_success_message "All started OK" > /dev/null
> or
> logger $(log_failure_message "Failed to start service")
But these examples don't make any sense!
The first one is a NOOP, and the second is totally broken. What is it
intended to do? Just relay the message to syslog? Then what is
log_failure_message doing there? Or is it _intentionally_ logging escape
characters to syslog ?
More importantly, if the initscript wanted to relay a message to the
user it is not the initscript's job to decide what channel to use
(syslog). In most cases the user wouldn't even see the syslogmessages,
so this would be not be a good way to send a message.
> Simply saying it "prints" it is so ambiguous and vague as to be useless.
I think there is a very clear and important distinction of
responsibility.
It is the responsibility of the initscript to detect the failure and to
produce an errormessage that will explain to the user what the problem
is.
It is the responsibility of the environment (the implementation of
log_failure_message) to find an appropriate channel to send this message
through.
I initially thought that you wanted to add the stdout requirement to
enable automatic testing, but since log_failure_message is allowed to modify
the message itself that would still not be possible.
Then what is the motivation behind this change?
Again, when running in a X environment at boot - why should the boot
environment not be allowed to implement log_*_message functions that will
send the messages to the X sessions without serialising warnings and
errors into a single stream?
--
Ragnar Kjørstad
Software Engineer
Scali - http://www.scali.com
Scaling the Linux Datacenter
More information about the OCF
mailing list