On Fri, 2 Apr 2004, Guido Guenther wrote:
> On Thu, Apr 01, 2004 at 06:17:03PM -0300, Fr=E9d=E9ric L. W. Meunier wrot=
e:
> > If you want to add something for all distributions, use
> > /usr/share/smartmontools (I don't see a better place) or
> > something, but not /etc/sysconfig. Or if you insist, make it
> > disabled by default.
> I'd prefer to have all configuration data in /etc. It would probably
> make sense to have the _format_ of the configuration file the same
> across all distributions but not the _location_.
I have a suggestion along these lines that might simplify our lives. I am
getting cold feet at the idea of addding another configuration file which
needs to be documented and maintained, and whose installation location
will have to be documented and maintain with yet another switch to
=2E/configure. While I appreciate the desire to be flexible, I think it's
important to try and keep the package as simple as we possibly can, both
for maintainers and users.
One alternative is to simply put this global information into smartd.conf. =
=20
Then there is no additional file or man page to maintain, and the problem
is solved. But this seems a bit nutty since we can accomplish what's
needed with a few shell variables. Bloating smartd with additional
parsing and error handling is inefficient.
I think I might prefer a simpler alternative. We currently distribute a
start-up script (smartd.initd.in) with smartmontools which supports many
distributions. Why don't we simply do the following? At the beginning of
the script, set a number of standard variables, like this:
SMARTD_INTERVAL=3D1800
SMARTD_ANOTHER_ARG=3DANOTHER_VAL
=2E..
Then, in the distribution-specific parts of the script, have:
# Redhat
if [ -f /etc/sysconfig/smartd ] ; then
. /etc/sysconfig/smartd
fi
# Debian
if [ -f /etc/defaults/smartmontools ] ; then
. /etc/defaults/smartmontools
fi
Within those files, users/distribution maintainers are welcome to
over-ride the default values of the variables, set at the top of the init
script.
Finally, in each place where smartd is called in the script, pass the
arguments explicitly. So, for example,
daemon /usr/sbin/smartd
becomes
daemon /usr/sbin/smartd --interval $SMARTD_INTERVAL --another_=
option $SMARTD_ANOTHER_VARIABLE
Advantages:
- simplicity and clarity
- some minor edits to smartd.initd.in are all that's needed
- each distribution has the file in its standard place
- if the file is not present, no problem, you just get
the standard defaults
- no additional ./configure script options to maintain.
Disadvanges:
I don't see any.
Cheers,
=09Bruce
|