[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian Policy "10.7.4 Sharing configuration files" question



Alexander GQ Gerasiov <gq@cs.msu.su> writes:

> I found, that package rtpg-www modifies /etc/hosts on installation/purge

> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=608451

> 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.

#!/bin/sh

set -e
umask 022
. /usr/share/debconf/confmodule

db_get rtpg-www/change_host

update_hosts()
{
        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
                update_hosts
        fi
    else
        update_hosts
    fi
fi

#DEBHELPER#

-- 
Russ Allbery (rra@debian.org)               <http://www.eyrie.org/~eagle/>


Reply to: