:: Re: [DNG] systemd is haunting me
Startseite
Nachricht löschen
Nachricht beantworten
Autor: Simon Wise
Datum:  
To: dng
Betreff: Re: [DNG] systemd is haunting me
On 02/02/16 22:22, Didier Kryn wrote:
> Le 02/02/2016 04:39, Simon Wise a écrit :
>> so looking at apt.conf I see as the very first text 'DESCRIPTION'
>>
>> /etc/apt/apt.conf is the main configuration file shared by all
>> the tools in the APT suite of tools, though it is by no means
>> the only place options can be set. The suite also shares a
>> common command line parser to provide a uniform environment.
>>
>> When an APT tool starts up it will read the configuration
>> files in the following order:
>>
>> 1. the file specified by the APT_CONFIG environment variable
>> (if any)
>>
>> 2. all files in Dir::Etc::Parts in alphanumeric ascending
>> order which have either no or "conf" as filename extension
>> and which only contain alphanumeric, hyphen (-),
>> underscore (_) and period (.) characters. Otherwise APT
>> will print a notice that it has ignored a file, unless
>> that file matches a pattern in the
>> Dir::Ignore-Files-Silently configuration list - in which
>> case it will be silently ignored.
>>
>> 3. the main configuration file specified by Dir::Etc::main
>>
>> 4. the command line options are applied to override the
>> configuration directives or to load even more
>> configuration files.
>>
>>
>> Dir::Etc::Parts is in fact apt.conf.d/
>>
>> as seen by going to the FILES section at the end of the manpage, either with a
>> search for Dir::Etc::Parts or because you know a FILES section usually exists:
>>
>> FILES
>> /etc/apt/apt.conf
>> APT configuration file. Configuration Item:
>> Dir::Etc::Main.
>>
>> /etc/apt/apt.conf.d/
>> APT configuration file fragments. Configuration Item:
>> Dir::Etc::Parts.
>
> This is also in man apt.conf, but - call me an idiot - I still can't make sense
> of it. What the hell is the meaning of the words 'Dir', 'Etc', 'Main' and
> 'Parts'? Why the hell do '::' translate to '/' ? What document did you learn
> that "language" from?


yes, it was man apt.conf I was quoting, and the syntax that puzzles you is the
one fully described in the rest of that manpage. The very next lines after the
that overview are these:

SYNTAX
        The configuration file is organized in a tree with options
        organized into functional groups. Option specification is
        given with a double colon notation; for instance
        APT::Get::Assume-Yes is an option within the APT tool group,
        for the Get tool. Options do not inherit from their parent
        groups.


Between this brief outline and the FILES section repeating the crucial default
values there are 800 or so lines detailing each of the many options that can be
set in these 4 places ... including the two that have /etc/apt/apt.conf and
/etc/apt/apt.conf.d/ as default values. You are looking at the document that
defines this syntax.

It is a very big, flexible configuration ... perhaps it should just dictate 'the
one true way' much more and thus be simpler. Perhaps it grew like topsy and
could have been more succinct, I don't know. Fortunately search works just fine
in manpages, so the relevant definitions are easy to find. Examples are
provided, if like me you often prefer them ... they are pointed to in the
standard manpage way, at the end, the lines before the FILES section:

EXAMPLES
        /usr/share/doc/apt/examples/configure-index.gz is a
        configuration file showing example values for all possible
        options.



>
> Another point: I'd expect the configuration tool to provide a way to specify a
> scope for any parameter setting, something which could, for example, restrict
> the scope of the line 'APT::Install-Recommends "false";' to synaptic, eg simply
> 'SYNAPTIC::Install-Recommends "false";'
>
> Maybe, since Synaptic is a front-end to apt, the rationale is it is also
> intended to tune apt proper. I admit it makes sense. It's imperfect because the
> setting is lost if you purge synaptic but nothing can be perfect.


... this is apt. It is being used by Synaptic as a backend, Synaptic calls it
not the other way round. Apt knows nothing of Synaptic. Apt does not know if it
was Synaptic that called it or some other app or the user.

Synaptic has installed a change to the usual apt default. I gather that this is
because it has a GUI option offered to set this. It is a good thing that
Synaptic sets this in this place, overriding any other defaults but not the
manual config file that someone would add if they wanted to configure apt
directly. The placement as 99synaptic and the slightly rude neglect of comments
is perhaps because the GUI developers assumed their users installed it exactly
because they did not want to look at configuration files, manpages or this
syntax ever again if they could avoid it. That is why they offer GUI options to
change apt defaults, and try to override all other packages doing the same by
using 99.

Appropriately /etc/apt/apt.conf, which is that file anyone wishing to add their
own configuration for apt would add, is 3/ in the above list ... that is it
overrides any of the defaults added by any packages, including synaptics GUI
thingy. 4/ is the command line so it overrides all the rest, as it should.

Simon