Hi,

Michael Ablassmeier <[EMAIL PROTECTED]> wrote:

> hi again,
>
> On Fri, Jan 26, 2007 at 09:21:09AM +0100, Michael Ablassmeier wrote:
>> On Thu, Jan 25, 2007 at 11:26:47PM -0800, Jeremiah Mahler wrote:
>> > Upgrading this package will over write /etc/zabbix_agentd.conf
>> > causing any changes to be lost.  Most notably the
>> > Server=myhost.localdomain is set to Server=localhost causing data
>> > to be lost until this line is fixed.
>> 
>> Please note that this only happens with the Server= line in the
>> configuration files, all other settings are *not* overwritten.
>> 
>> Some ugly way would be to read the configuration file on upgrade and
>> check if the debconf setting and the one from the file match, if not,
>> leave it alone.

No, this is not "some ugly way".  Parsing the configuration file is the
preferred and documented way to do it, see "Config file handling" in
debconf-devel(7).  debconf is not a registry, it's just a cache to hand
on information from the config script to the postinst script, not from
one invocation of the maintainer scripts to the next.

> or using ucf ..

Unless it's very hard to parse zabbix_agent.conf, this would probably be
overkill.  A bit overstretched, but with some truth:

(15:19:00) Zugschlus: p2-mate: ucf does 50 % of dpkg conffile handling
           pretty well, much better than dpkg does. The other 50 % it
           does not at all, and its maintainer thinks that it is ok to
           offer ~ 30 lines maintainer script code as acceptable
           workaround.

Gruß, Frank
-- 
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)

Reply via email to