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

Re: What should postrm purge actually do?



Richard Kettlewell writes ("What should postrm purge actually do?"):
> Is it written down anywhere what postrm purge is supposed to do? 
> Presumably remove some set of files, but what criteria should be used to 
> choose which?

It's a shame that this isn't more clearly documented.

> The policy document is not much help; s6.8 says when it is called, but 
> not what it actually needs to do.  I can't find more detail, though of 
> course I may have missed it.
> 
> Things I think it should remove:
>     - generated configuration files

Definitely.

> Things I'm uncertain about, but that wouldn't be missed:
>     - infrastructural stuff (lockfiles, sockets, etc)
>     - files containing cached data

Absolutely, it should remove all of these.  You should remove these on
postrm remove, in fact, and not wait for purge.

> Things I'm uncertain about, that someone might actually miss:
>     - log files

Yes, these should be removed.

I have an old version of the policy manual from before it was merged
with the dpkg programmers' manual, and that says to remove logfiles on
purge.

>     - data accumulated from users

> Configuration files might be missed too, so obviously --purge isn't 
> intended to be nondestructive, the question is how destructive is it 
> supposed to be and to what extent is it responsible for tidying up.

I think you are allowed to make a judgement call here.

The usual thing to do would definitely be to remove _everything_, so
as to put the system back almost to the state as if the package hadn't
been installed.  (There may be minor exceptions, such as leaving users
in passwd to avoid uid reuse.)

But I think for example database packages don't generally remove their
actual database data when they're purged, because they think the data
is likely to be exceptionally important to the admin.  Something
that's exceptionally important is both more desirable to keep, and
also less of a problem if the admin needs to manually tidy it up.

Personally I would lean on the side of deleting the disorder
user-entered data on purge but I can see arguments on both sides.

Ian.


Reply to: