Feedback

type to search

What is the best way to create a custom package that configures other packages?

Asked by [ Editor ] , Edited by Marco Amadori [ Editor ]

What is the best way to create a custom package that configures other packages?

NN comments
depaloan
-

Do you need to launch debconf or to make modification to other packages configuration files?

helmut
-

To me this question looks like a XY problem. You want to do X and think Y is the solution. So you ask about Y, but Y not necessarily is the best solution.

Also providing specific information helps people who try to answer your question.

marco.amadori
-
de palo I would like to keep the question generic, imagine a package that needs preconfiguring and/or reconfiguring debconf and modify config files. This opens also update issues about how to update configurations and in which maintainer scripts.

marco.amadori
-

The problem I have is generic, not specific. All system I’m using right now seems hackish to me, I needed so far configuration packages to configure (pre and post) apache2, mysql, bind9, dhcp, icecast and more server-like packages; with complex actions as using debconf-db for mysql, adding users and so on.

In order to do so I put most of my configurations in postinst, with carefully removing it in prerm/postrm. But I find it easely unmaintainable when packages it configures changes.

or Cancel

2 answers

1

anarcat [ Editor ]

In short: don’t do that. It is actually against the Debian policy for a package to modify other package’s files (section 7.6.1), so you’ll have very little success going that route, or at the very least: getting it into Debian. This is also “the wrong way” of doing things because, as you said, the configured package will not call the configuration package so that it can update the config files.


You should instead use something like puppet or cfengine to manage configuration on top of your packages.
or Cancel
0

lifeisfoo [ Editor ]

If you want to configure your system, one way is config-package-dev.

NN comments
marco.amadori
-

This seems a nice framework which tries to resolve most of the issues I’m having.

I’m curious about the opinion of other debian sysadmin and developer around.

The main trouble is that the config-[package] maintainer script will not invoked when the configured package is updated. Some dpkg/apt hook magic is required there.

or Cancel

Your answer

You need to join Debian to complete this action, click here to do so.