On Saturday 10 March 2007 21:37, Justin Pryzby wrote: > On Sat, Mar 10, 2007 at 08:05:55PM +0100, Magnus Holmgren wrote: > > Something I've been thinking about: > > > > If two packages share a /var/(lib|run|log) subdirectory, how do you know > > when to remove it? I reckon that it should be removed when the last of > > the packages has been purged. Both packages place files there at runtime, > > so dpkg won't remove it since it's nonempty. But you can't just remove it > > in postrm if it's empty. Do you: > > > > a) leave it alone; let root delete it manually when it's no longer needed > > b) use dpkg -S to see if it's still in use > > c) use dpkg -l to see if the other package is still installed > > d) avoid sharing directories under /var > > e) do something else? > > The easy thing to do is to include it in the package, rather than > creating it in maintainer scripts. Then dpkg leaves it alone if another > package also includes (and in recent releases may even succeed in not > warning you). I think there are cases where it is advantageous not to > include it, but they don't occur to me presently.. The directory is included in the packages, that's why I wrote that dpkg won't remove it. The problem is that postrm purge is called after dpkg removes the last of a package's files. Thus we have to delete not only the files, but also the directories, that are not deleted already in postrm remove. -- Magnus Holmgren holmgren@lysator.liu.se (No Cc of list mail needed, thanks) "Exim is better at being younger, whereas sendmail is better for Scrabble (50 point bonus for clearing your rack)" -- Dave Evans
Attachment:
pgpyYsCI6EUfj.pgp
Description: PGP signature