Comment 8 for bug 1483923

Revision history for this message
Thomas Ward (teward) wrote :

I'm going to take the following actions on this bug, and the Server Team is OK'd to say otherwise, since I'm slightly sleep deprived.

> Agreed, no need to patch this in Ubuntu. Should be done in Debian, which I can see would have the same problem. -- Benjamin Bach, November 11, 2015, Comment 7

Given that there is no need to patch this in Ubuntu, and this should be done in Debian, I am going to "Won't Fix" this bug here, and suggest that you file a bug against the Debian package and have them fix it there. If they decide to make changes, they'll make it in when I next merge the package from Debian Unstable. This link is Debian's "How to File a Bug" page and can help you get started with filing a bug in Debian against the nginx package for this issue (since it should really be fixed there): https://www.debian.org/Bugs/Reporting

> AIUI, it isn't appropriate for a package to modify another package's behaviour from under its feet in this way. Debian Policy Appendix G (not formally policy I don't think) says: "Do not attempt to divert a conffile, as dpkg does not handle it well.". -- Robie Basak, November 11, 2015, Comment #6

Idle hands are the Devil's Playthings, so I went and poked the Debian IRC channels. #debian-mentors also refers to 10.7.4 of the Debian packaging policy - https://www.debian.org/doc/debian-policy/ch-files.html - which states the same thing in its contents:

I'm just going to quote it here for simplicity, with a later point below of what spots I'm specifically referring to:

---

10.7.4 Sharing configuration files

If two or more packages use the same configuration file and it is reasonable for both to be installed at the same time, one of these packages must be defined as owner of the configuration file, i.e., it will be the package which handles that file as a configuration file. Other packages that use the configuration file must depend on the owning package if they require the configuration file to operate. If the other package will use the configuration file if present, but is capable of operating without it, no dependency need be declared.

If it is desirable for two or more related packages to share a configuration file and for all of the related packages to be able to modify that configuration file, then the following should be done:

One of the related packages (the "owning" package) will manage the configuration file with maintainer scripts as described in the previous section.

The owning package should also provide a program that the other packages may use to modify the configuration file.

The related packages must use the provided program to make any desired modifications to the configuration file. They should either depend on the core package to guarantee that the configuration modifier program is available or accept gracefully that they cannot modify the configuration file if it is not. (This is in addition to the fact that the configuration file may not even be present in the latter scenario.)

Sometimes it's appropriate to create a new package which provides the basic infrastructure for the other packages and which manages the shared configuration files. (The sgml-base package is a good example.)

If the configuration file cannot be shared as described above, the packages must be marked as conflicting with each other. Two packages that specify the same file as a conffile must conflict. This is an instance of the general rule about not sharing files. Neither alternatives nor diversions are likely to be appropriate in this case; in particular, dpkg does not handle diverted conffiles well.

When two packages both declare the same conffile, they may see left-over configuration files from each other even though they conflict with each other. If a user removes (without purging) one of the packages and installs the other, the new package will take over the conffile from the old package. If the file was modified by the user, it will be treated the same as any other locally modified conffile during an upgrade.

The maintainer scripts must not alter a conffile of any package, including the one the scripts belong to.

---

The specific points I read on this are as follows:

- Two packages that specify the same file as a conffile must conflict. *This is an instance of the general rule about not sharing files.* Neither alternatives nor diversions are likely to be appropriate in this case; in particular, dpkg does not handle diverted conffiles well.

- The maintainer scripts must not alter a conffile of any package, including the one the scripts belong to.

Because I see this, I believe the `dpkg-divert` approach is the wrong way to do it, and therefore this is an invalid approach for this, and not something we need to fix, at least if we stick to Debian packaging policy.

But, I'll leave that decision to Debian, since that's outside the scope of Ubuntu, in my opinion.

In either case, I am marking this bug down here in Ubuntu as "Won't Fix", and I suggest you file a bug in Debian if you want Debian's nginx packagers to look at the issue further.