Debian Developers - Configuration by using local packages

This is Interesting: Free IT Magazines  
Home > Archive > Debian Developers > April 2004 > Configuration by using local packages





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Configuration by using local packages
W. Borgert

2004-04-25, 10:34 am

Hi,

I like to know of your approach for the non-manual configuration
by using local packages. The ways I know, are:

1. Create local version of the original package with the "right"
configuration included, e.g. using dpkg-repack. Version number
(or epoch) must be higher than original versions.

=> BAD - New versions with important fixes or new features are
not available anymore.

2. Create local (empty) package, that have the same config files
as the original packages and using diversions.

=> BAD - In my experience diversions just don't work with config
files.

3. Create local (empty) package overwriting existing config files
by using cp in postinst.

=> relatively BAD - If new important sections or keywords appear
in the config files, they are just over-written.

4. Create local (empty) package fiddling more intelligently with
existing config files, e.g. by using cfengine.

=> never tried this, never used cfengine

5. ???

Thanks in advance for your comments!

Cheers, WB


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Bernhard R. Link

2004-04-26, 4:33 am

* W. Borgert <debacle@debian.org> [040425 16:29]:
> 3. Create local (empty) package overwriting existing config files
> by using cp in postinst.
>
> => relatively BAD - If new important sections or keywords appear
> in the config files, they are just over-written.


Well, isn't that the point of having your own config files around?
If dpkg updates a package in a way it would have a new config file,
it will just warn you as if you changed the file manually. Thus
you can see if you want to change the config you ship. (If there
is anything bad at it, then that one will get this questions on every
host one upgrades).

Hochachtungsvoll,
Bernhard R. Link

--
Sendmail is like emacs: A nice operating system, but missing
an editor and a MTA.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Goswin von Brederlow

2004-04-26, 11:34 am

"Bernhard R. Link" <blink@informatik.uni-freiburg.de> writes:

> * W. Borgert <debacle@debian.org> [040425 16:29]:
>
> Well, isn't that the point of having your own config files around?
> If dpkg updates a package in a way it would have a new config file,
> it will just warn you as if you changed the file manually. Thus
> you can see if you want to change the config you ship. (If there
> is anything bad at it, then that one will get this questions on every
> host one upgrades).
>
> Hochachtungsvoll,
> Bernhard R. Link


But if you update the local package it silently overwrites changes.

Using ucf seems better but its still a dirty hack.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
W. Borgert

2004-04-27, 6:34 pm

Hi,

> * W. Borgert <debacle@debian.org> [040425 16:29]:
>
> Well, isn't that the point of having your own config files around?
> If dpkg updates a package in a way it would have a new config file,
> it will just warn you as if you changed the file manually. Thus
> you can see if you want to change the config you ship. (If there
> is anything bad at it, then that one will get this questions on every
> host one upgrades).


Maybe I didn't make my point clear: If I create a local
(empty) package, that overwrites existing config files - of
other packages! - by using cp in - it's own - postinst, this
will just overwrite the config files, no matter what version
they are etc. My conclusion: "relatively BAD".

Cheers,
--
W. Borgert <debacle@debian.org>, http://people.debian.org/~debacle/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
W. Borgert

2004-04-27, 7:34 pm

Hi,

> But if you update the local package it silently overwrites changes.
>
> Using ucf seems better but its still a dirty hack.


My understanding of ucf is, that the "original" package has
already to use it to make it work. Example: I have a local
configuration of NIS, so I install the Debian nis package
and my nis-local package, that overwrites /etc/yp.something
- can I use ucf for this in nis-local, even if the Debian
nis package does not use it?

So, what is the best way to handle this?

Cheers,
--
W. Borgert <debacle@debian.org>, http://people.debian.org/~debacle/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Goswin von Brederlow

2004-04-27, 8:34 pm

"W. Borgert" <debacle@debian.org> writes:

> Hi,
>
>
> My understanding of ucf is, that the "original" package has
> already to use it to make it work. Example: I have a local
> configuration of NIS, so I install the Debian nis package
> and my nis-local package, that overwrites /etc/yp.something
> - can I use ucf for this in nis-local, even if the Debian
> nis package does not use it?


If you edit the config afterwards or let dpkg overwrite it when
updating nis your nis-local package would find out and ask you how to
handle the situation.

That would be the benefit, nothing else.

> So, what is the best way to handle this?


For nis and build your own with your own config, i.e. build a
non-empty nis-local that replaces,conflict,provides nis.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
W. Borgert

2004-04-28, 3:33 am

On Wed, Apr 28, 2004 at 02:20:05AM +0200, Goswin von Brederlow wrote:
> "W. Borgert" <debacle@debian.org> writes:
> If you edit the config afterwards or let dpkg overwrite it when
> updating nis your nis-local package would find out and ask you how to
> handle the situation.


I'm not sure: If a config file is in package nis, it cannot
be in package nis-local, too without having the a conflict,
right?

> For nis and build your own with your own config, i.e. build a
> non-empty nis-local that replaces,conflict,provides nis.


But nis is only an example - I have ten or twenty packages
with some local configuration (samba, apache, ...). It's
not an option to have all those packages in local variants.

That's why I asked about more "intelligent" way of config
file handling, like cfengine in postinst. Nobody tried
this?

Cheers,
--
W. Borgert <debacle@debian.org>, http://people.debian.org/~debacle/


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Bernhard R. Link

2004-04-28, 6:33 am

* W. Borgert <debacle@debian.org> [040428 00:21]:
> Maybe I didn't make my point clear: If I create a local
> (empty) package, that overwrites existing config files - of
> other packages! - by using cp in - it's own - postinst, this
> will just overwrite the config files, no matter what version
> they are etc. My conclusion: "relatively BAD".


That sounds like the same situation I have. Such local packages
are an abuse of the package managment system to get something
sone easily. And I want an langer amount of computers be configured
identically[1], as they shall behave identically and I want be able to
test and reconstruct things on any computer. As I want to have exactly
the same packages installed on each of them[2]. Thus as the computers are
homogenous enough, I just ship the configuration (except some things
like lilo.conf, which I do not want to have around in plain-text too
often) in a single local package, that overrides everything found there.
If I as in the habit of forgetting to revert local changes, I'd even
install a cronjob comparing the files, sending me a diff and installing
the version in the package.

Or in less words: Such a local package is equivalent to a scp of your
config files to all computers involved. If thus is what you need it
is a nice way to get there. If it is not what you want, it is of course
bad, but so is almost anything one does not want.

Hochachtungsvoll,
Bernhard R. Link

[1] as far as this is possible with more or less different hardware. I
e.g. prefer to have the same graphics card in all of them to have
exactly one X-config to ship.
[2] and the same local packages like kernels and the like of course...

--
Sendmail is like emacs: A nice operating system, but missing
an editor and a MTA.


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Goswin von Brederlow

2004-04-28, 9:34 am

"W. Borgert" <debacle@debian.org> writes:

> On Wed, Apr 28, 2004 at 02:20:05AM +0200, Goswin von Brederlow wrote:
>
> I'm not sure: If a config file is in package nis, it cannot
> be in package nis-local, too without having the a conflict,
> right?


No. nis-local would have e.g. /usr/share/nis-local/myconfig and copy
that in its postinst, or so I understood the beginning of the thread.

>
> But nis is only an example - I have ten or twenty packages
> with some local configuration (samba, apache, ...). It's
> not an option to have all those packages in local variants.
>
> That's why I asked about more "intelligent" way of config
> file handling, like cfengine in postinst. Nobody tried
> this?


Forking them would be clean, breaking policy and overwriting their
config from another deb would be practical.

In most cases you can find a middle ground:

Package nis-local with configs in /etc/nis-local/. In the postinst
file you dpkg-divert the nis packages to wraper scripts that start the
real nis programms but with extra options so they use the configs in
/etc/nis-local/ instead of their usual place.

Not sure if you can do that with nis but with samba or apache that
should be possible. You would even have policy compliant debs.

MfG
Goswin


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
W. Borgert

2004-04-28, 11:34 am

Quoting Goswin von Brederlow <brederlo@informatik.uni-tuebingen.de>:
> "W. Borgert" <debacle@debian.org> writes:
>
> No. nis-local would have e.g. /usr/share/nis-local/myconfig and copy
> that in its postinst, or so I understood the beginning of the thread.


Yes, that was my original intention. I mis-understood your
proposal to have the same config files in both packages.

...[vbcol=seagreen]
> Package nis-local with configs in /etc/nis-local/. In the postinst
> file you dpkg-divert the nis packages to wraper scripts that start the
> real nis programms but with extra options so they use the configs in
> /etc/nis-local/ instead of their usual place.


nis is just an example. Other config files, like /etc/nsswitch.conf,
are also to be changed. In this case I would have to fork libc, I
believe. I don't like to do that.

> Not sure if you can do that with nis but with samba or apache that
> should be possible. You would even have policy compliant debs.


So I have compliant debs and not so compliant software. Man
pages, books etc. tell about having a config file /etc/xyz,
but my local versions are completely different. That's not
so nice (IMHO).

Cheers, WB


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com