Re: Debian Policy "10.7.4 Sharing configuration files" question
Alexander GQ Gerasiov <firstname.lastname@example.org> writes:
> I found, that package rtpg-www modifies /etc/hosts on installation/purge
> I thing this violate 10.7.4
> "The maintainer scripts must not alter a conffile of any package,
> including the one the scripts belong to."
> But maintainer disagrees with me arguing that preinst asks user, and
> that's user who modify /etc/hosts (using preinst, eah).
Well, that part of 10.7.4 doesn't apply in this case because /etc/hosts is
not a conffile.
However, it remains the case that two different packages may not manage
the same configuration file. This is particularly important for
/etc/hosts, which is intentionally left entirely under the control of the
local system administrator after initial installation and is particularly
sensitive in that regard.
Policy lays out what has to be done if a configuration file is meant to be
shared, but I don't think it's at all useful to consider /etc/hosts to be
a shared configuration file. I think a package that requires manipulating
/etc/hosts is doing something fundamentally wrong, and needs to be fixed
to not have that requirement. Host naming and resolution is about as
firmly the exclusive business of the local system administrator as
anything about a system's configuration can be, and should not be messed
with by packages.
For reference for others reading this, the postinst of the relevant
package follows. Note that it adds an unqualified hostname, potentially
shadowing a system in the local domain, if the user agrees to update
/etc/hosts. The debconf question is priority: high and defaults to true.
It looks like the purpose of the alias is because the package configures
an Apache virtual host named rtpg, which I think is also questionable and,
IIRC, contrary to the draft webapp policy.
I get the impression that the intent of this package is to set up a local
web interface as essentially a cheap form of GUI to control a local daemon
on the system, which is an interesting problem for which Debian does not
currently have good infrastructure support.
echo 127.0.0.1 rtpg-scgi.localhost rtpg >> /etc/hosts
if test "$RET" = true; then
if test -f /etc/hosts; then
if ! grep -q rtpg-scgi /etc/hosts; then
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>