The purpose of /etc/default ?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

The purpose of /etc/default ?

Jari Aalto-5

The package contributors guide

    http://cygwin.com/setup.html

Is silent about /etc/defaults. In Debian this directory has specific
meaning:

    http://www.debian.org/doc/debian-policy/ch-opersys.html

    9.3 System run levels and init.d scripts
    9.3.2 Writing the scripts

    Often there are some variables in the init.d scripts whose values
    control the behaviour of the scripts, and which a system
    administrator is likely to want to change. As the scripts
    themselves are frequently conffiles, modifying them requires that
    the administrator merge in their changes each time the package is
    upgraded and the conffile changes. To ease the burden on the
    system administrator, such configurable values should not be
    placed directly in the script. Instead, they should be placed in a
>>  file in /etc/default, which typically will have the same base name
    as the init.d script. This extra file should be sourced by the
    script when the script runs.

What does /etc/defaults mean under Cygwin? This should be documented
in the package contributors guide as well.

Jari

Reply | Threaded
Open this post in threaded view
|

Re: The purpose of /etc/default ?

Yitzchak Scott-Thoennes
On Wed, Feb 08, 2006 at 06:29:40PM +0200, Jari Aalto wrote:
>
> The package contributors guide
>
>     http://cygwin.com/setup.html
>
> Is silent about /etc/defaults.

As is FHS 2.3.  I don't even see any discussion of /etc/defaults on
the FHS discussion list.  /usr/share/foo/ may be a more appropriate
place, depending on whether you view these files as configuration
files (since their content is that of a configuration file) or data
files (since they aren't actually *used* as configuration files, just
compared to the live conf file and potentially copied to become the
live configuration file).

> In Debian this directory has specific
> meaning:
>
>     http://www.debian.org/doc/debian-policy/ch-opersys.html
>
>     9.3 System run levels and init.d scripts
>     9.3.2 Writing the scripts
>
>     Often there are some variables in the init.d scripts whose values
>     control the behaviour of the scripts, and which a system
>     administrator is likely to want to change. As the scripts
>     themselves are frequently conffiles, modifying them requires that
>     the administrator merge in their changes each time the package is
>     upgraded and the conffile changes. To ease the burden on the
>     system administrator, such configurable values should not be
>     placed directly in the script. Instead, they should be placed in a
> >>  file in /etc/default, which typically will have the same base name
>     as the init.d script. This extra file should be sourced by the
>     script when the script runs.
>
> What does /etc/defaults mean under Cygwin? This should be documented
> in the package contributors guide as well.

I think debian is on firmer ground than cygwin in putting files in
/etc/defaults since they are sourced extensions of the real
configuration files.
Reply | Threaded
Open this post in threaded view
|

Re: The purpose of /etc/default ?

Brian Dessent
Yitzchak Scott-Thoennes wrote:

> > What does /etc/defaults mean under Cygwin? This should be documented
> > in the package contributors guide as well.
>
> I think debian is on firmer ground than cygwin in putting files in
> /etc/defaults since they are sourced extensions of the real
> configuration files.

These two are separate concepts entirely.

In debian, /etc/default/ is a directory of mostly empty (or very small)
files.  The way it is meant to work is that each /etc/init.d/foobar
script first sources /etc/default/foobar before starting/stopping the
foobar service.  The purpose of the file is to provide extra options for
when starting the service, or override certain aspects of the service's
startup.  A common way this is used is so a package can go ahead and
install the whole /etc/rc.d/ structure for automatic startup/shutdown,
but not actually start it until the user edits /etc/default/foobar to
really enable it by setting "FOOBAR_ENABLED=1".  This way you don't have
to worry about daemons being automatically started when the user hasn't
yet configured them.

Note that these are NOT the actual primary configuration files that the
daemon uses -- those are always the standard /etc/foobar.conf-type
files.  The *only* purpose of these /etc/default/foobar files is to
provide extra overrides or startup options on top of whatever
configuration the daemon already has.  These are *not* templates and
they *are* meant to be user-edited.

That is completely different than cygwin's use of /etc/defaults/, which
is meant to be a tree of default conf files, to be copied into /etc/,
and used as the actual primary configuration file for whatever package.
They are *not* meant to be user-edited.

Not that any of this really matters for this discussion, but the part in
debian about /etc/default/ is an entirely different concept than the
/etc/defaults/ in Cygwin.

Brian
Reply | Threaded
Open this post in threaded view
|

Re: The purpose of /etc/default ?

Jari Aalto-5
Brian Dessent <[hidden email]> writes:

>
>> > What does /etc/defaults mean under Cygwin? This should be documented
>> > in the package contributors guide as well.
>
> In debian, /etc/default/ is a directory of mostly empty (or very small)
> files.  The way it is meant to work is that each /etc/init.d/foobar
> script first
>
> Note that these are NOT the actual primary configuration files that the
> daemon uses ... These are *not* templates and
> they *are* meant to be user-edited.

In Debian /etc/deaults contain's confiuration files in spirit of the
FHS which reserves whole /etc hierarcgy to include configuration files
only.

        /etc : Host-specific system configuration
        http://www.pathname.com/fhs/pub/fhs-2.3.html#PURPOSE6
        ...
        The /etc hierarchy contains configuration files. A
        "configuration file" is a local file used to control the
        operation of a program; it must be static and cannot be an
        executable binary.

> That is completely different than cygwin's use of /etc/defaults/, which
> is meant to be a tree of default conf files, to be copied into /etc/,
> and used as the actual primary configuration file for whatever package.
> They are *not* meant to be user-edited.

The question is, is the /etc/defaults in Cygwin proper place to store
the non-user editable files that are ment to be used only as
"templates", which new upgrades will always overwrite.

Would it be better to reserve whole /etc off limits and make it user's
territory. Perhaps the defaults would be better stored under the
individual packages, like in

    /share/<package>/defaults

Or along with the documentation? This would be more near to the
instructions (README*) where the seup of the program may be explained
in full:

    /usr/share/doc/<package>/{examples | defaults}/

Jari

Reply | Threaded
Open this post in threaded view
|

Re: The purpose of /etc/default ?

Brian Dessent
Jari Aalto wrote:

> The question is, is the /etc/defaults in Cygwin proper place to store
> the non-user editable files that are ment to be used only as
> "templates", which new upgrades will always overwrite.
>
> Would it be better to reserve whole /etc off limits and make it user's
> territory. Perhaps the defaults would be better stored under the
> individual packages, like in
>
>     /share/<package>/defaults
>
> Or along with the documentation? This would be more near to the
> instructions (README*) where the seup of the program may be explained
> in full:
>
>     /usr/share/doc/<package>/{examples | defaults}/

Putting them in /usr/share/doc/package-<VER>/ is just clumsy because
then you have to use scripting to determine the right <VER> which
changes with each package version.  It's so much simpler for the
postinstall/preremove if the location is a constant.
/usr/share/package/defaults/file.conf would work though.

But, there is already an established precedent for unpacking default
config files in /etc/defaults -- I count 15 existing packages that use
this directory.  Since it looks like there is no definitive standard for
this kind of thing one way or the other, I can't see any real reason for
redoing all that work and moving them elsewhere other than just to be
pedantic.

It will end up being like the move from /usr/{man,doc} to
/usr/share/{man,doc} -- there are *still* some old packages that use
/usr/doc, and thus the unknowing user has yet another potential place to
look for docs.  Of course in that case there was a real reason to move
(FHS) and in the case of examples it's not something the user would
necessarily care about.  But I still don't see a compelling need to move
them.

Brian
Reply | Threaded
Open this post in threaded view
|

Re: The purpose of /etc/default ?

Jari Aalto-5
Brian Dessent <[hidden email]> writes:

> Jari Aalto wrote:
>> Would it be better to reserve whole /etc off limits and make it user's
>> territory. Perhaps the defaults would be better stored under the
>> individual packages, like in
>>
>>     /share/<package>/defaults
>>
>> Or along with the documentation?
>>
>>     /usr/share/doc/<package>/{examples | defaults}/
>
> Putting them in /usr/share/doc/package-<VER>/ is just clumsy because
> then you have to use scripting to determine the right <VER> which
> changes with each package version.  It's so much simpler for the
> postinstall/preremove

In a sense, each package install may potentially carry new verion of
the default configuration and keeping it along with package would then
be clean. IT just requires little scripting to determine
/usr/share/doc/package-<VER>/, but it's not tat hard.

> if the location is a constant. /usr/share/package/defaults/file.conf
> would work though.

This would be better alternative than the current /etc

> But, there is already an established precedent for unpacking default
> config files in /etc/defaults -- I count 15 existing packages that use
> this directory.  Since it looks like there is no definitive standard for
> this kind of thing one way or the other, I can't see any real reason for
> redoing all that work and moving them elsewhere other than just to be
> pedantic.
> (FHS) and in the case of examples it's not something the user would
> necessarily care about.  But I still don't see a compelling need to move
> them.

The issue of /etc/defaults has been gone unnoticed, so we can always
refactor the situation. Taking your word on 15 packages doesn't sound
like big transition when it doesn't have to be immediate.

How does Redhat, Suse, Madrive, Slackware treat the /etc ?

Jari


Reply | Threaded
Open this post in threaded view
|

Re: The purpose of /etc/default ?

Brian Dessent
Jari Aalto wrote:

> In a sense, each package install may potentially carry new verion of
> the default configuration and keeping it along with package would then
> be clean.

But that will work fine with either method.  The old default will be
removed before the new package is unpacked in both cases.  There will at
any given time be at most one instance of this file on disk, so it
really doesn't matter that it's put in a versioned directory name or not
-- except for the fact that the postinstall/preremove is needlessly more
complex.

> IT just requires little scripting to determine
> /usr/share/doc/package-<VER>/, but it's not tat hard.

Yes but why impose extra maintainer effort, complication, and chance for
error on at least a dozen existing packages for no clear benefit?  Isn't
volunteer maintainer time a precious resource that we don't want to
waste?

Brian