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

Re: NEVER remove log files without asking



On Mon, Aug 16, 2004 at 06:26:00PM -0500, Steve Greenland wrote:
> On 16-Aug-04, 17:41 (CDT), "Jamin W. Collins" <jcollins@asgardsrealm.net> wrote: 
> > And what about other directories?  Such as /var/lib/$package/ or
> > /usr/share/$package/, is the admin to assume that these directories
> > are also sacrosanct and owned by the package?  That their
> > sub-directories or contents can be removed even though the files may
> > not have been created by the package?
> 
> The difference is that Policy doesn't mandate the removal of those
> files.

Policy doesn't mandate the removal of the log files.  Section 10.8
indicates that:

   Log files should be removed when the package is purged

This is a "should" not a "must".  Additionally, I see nothing in policy
that indicates that the package should/must blindly remove all files in
a directory that it used to store some of it's files.

> > Err on the side of caution, don't blindly remove directories that
> > may contain files your package didn't put there.  If you're not very
> > certain the files were created by your package don't remove them.
> 
> In general, yes. But I don't think it's unreasonable for the apache
> maintainer to assume that /var/log/apache is full of apache log files,
> put there by apache. How is the postrm supposed to distinguish log
> files it's supposed to remove, because Policy 10.8 requires it, vs.
> log files that the user wants to keep? Just those named 'access.log'?
> Or is it 'access.log.*'. Or 'access.log.*' in subdirs?

It's not a simple problem to solve, but that doesn't mean that it should
be alright for the package to blindly remove all files and/or
subfolders.  Perhaps some configuration parsing is in order?

> Is it wrong for package foobar to 'rm -rf /var/cache/foobar' when it
> is purged?

Yes.  Blindly removing any folder is bad.

-- 
Jamin W. Collins

To be nobody but yourself when the whole world is trying it's best night
and day to make you everybody else is to fight the hardest battle any
human being will fight. -- E.E. Cummings



Reply to: