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

Bug#22935: PROPOSED] Do not make hardlinks to conffiles



On Tue, Jun 20, 2000 at 10:08:30AM -0700, Chris Waters wrote:
> On Tue, Jun 20, 2000 at 09:50:58AM +0100, Julian Gilbey wrote:
> > OK, so where do we stand on this one?
> 
> > The proposal is to add a requirement to policy (Ron's wording):
> 
> >   A package may not make hard links to conffiles.
> >   Rationale: This is because hardlinks are likely to point to the old
> >   config files after an upgrade, which is probably not the intended
> >   behavior.
> 
> The rationale doesn't make sense.  If a package upgrades the conffile,
> it should upgrade all its links.  If it doesn't, then it has a bug.
> 
> OTOH, it could certainly be confusing to the admin/user who edits the
> conffile.  Getting the links out of sync by hand is probably all too
> easy to do (depending on your editor).  Therefore I support the
> proposal, but would like to see a better official rationale.  How
> about:
> 
> Rationale: this is because an admin might edit a conffile without
> updating the links, resulting in an inconsistent system.

I don't believe that this is the problem.  As far as I understood it,
what happens is this.  Call the files /etc/foo.conf (the conffile) and
/var/pkg/conf (the hardlink).

(1) Sysadmin edits /var/pkg/conf.  No problems: /etc/foo.conf remains
    a hardlink to /var/pkg/conf and the files are still in sync.

(2) The sysadmin upgrades the foo package.  Dpkg notices that
    /etc/foo.conf has changed and offers to upgrade it.  The sysadmin
    agrees.  Now what happened seems to be that after this (and I
    don't quite know how this works exactly) /etc/foo.conf is mv'ed to
    /etc/foo.conf.dpkg-old, /var/pkg/conf remains a hard link to it,
    that is to /etc/foo.conf.dpkg-old, and /etc/foo.conf is the new
    conffile.  But now the /var/pkg/conf file is the old conffile and
    /etc/foo.conf is the new one.  Oops.

So the upgrading of the package causes the problem and (if the
original bug report is still correct) then there is nothing which will
prevent upgrading the package and accepting the new conffile from
breaking the hard links.

Hence the given rationale.

   Julian

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

  Julian Gilbey, Dept of Maths, QMW, Univ. of London. J.D.Gilbey@qmw.ac.uk
        Debian GNU/Linux Developer,  see http://www.debian.org/~jdg
  Donate free food to the world's hungry: see http://www.thehungersite.com/



Reply to: