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

Re: Repost: RFC and preliminary RFS: prayer webmail



On Sat, Mar 10, 2007 at 10:19:57PM +0100, Magnus Holmgren wrote:
> 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.
dpkg will remove it, if it's included in the package, if there are no
conffiles (this [should] only happen[s] when it's in /etc) or other dpkg
files, and (naturally) if it's empty.  I think the recent change for
etch was to retry removal of non-shared directories for which removal
failed during "remove" during "purge" and only warn if they failed both
times.

Justin



Reply to: