Re: Bug#201023: dosemu: purging doesmu wipes out all user data
On Mon, 2003-07-21 at 09:40, Samium Gromoff wrote:
> I think the issue can be addressed by a finer file classification.
> It seems to me its a classical case of not-enough-information.
>
> 1. data/exec files
> 2. default/generated config files
> 3. _user_modified_ config files
>
> The whole issue seem to be caused by the fact we do not distinguish
> between 2 and 3.
>
> For instance i believe we should clearly remove 2 and keep 3.
Actually we need to notice one more type of file than Emile did in
http://marc.theaimsgroup.com/?l=debian-devel&m=105822874604492&w=2 ,
namely, configuration files that aren't conffiles. Making the
distinction above we have:
1. dpkg -L
2a. original conffiles
2b. modified conffiles
3. configuration files that aren't conffiles, in /var/lib/
4. log output, cached compiled versions of conffiles, etc.
5. user data created using the package
#1 is of course removed at purge time. There seems to be
a consensus here that #5 should not be removed. #4 must
be removed. #2a can safely be removed. We are accustomed
to #2b and #3 being removed. I agree with all of this.
Now all we have to do is agree on this a bit more formally.
Here is my suggestion for how purge should be handled. Purge
would delete #1 through #4 _and_ everything in /var/lib/<pckg>/.
User data created using the package must then not be stored in
/var/lib/<pckg>/ but somewhere else, e.g., in someone's home
directory. Dosemu, for example, could store the not-to-be-purged
DOS image in user "dosemu"'s home dir.
Would that work?
I would emphasize here that the postrm must never do "rm -rf"
on an /etc/ subdirectory. In order to make it easier for
packages to obey this rule, I suggest that dpkg be enhanced
so that the control file can contain a "Config-Files:" field.
This would list all configuration files stored in /etc/ that
are not handled as conffiles. The files in the Config-Files
list would be deleted on purge by dpkg. This would save
the maintainer a bit of effort and would also provide a way
for one package to take over, as configuration files, files
that had belonged to another package as conffiles. See bug
report #163657 for more information about this problem.
Several people have said that /var/lib/<pckg>/ should not be
removed, but I think that that may not be practical. It would
in some cases be too difficult for maintainers to keep track
of each and every file that is created in /var/lib/<pckg>/.
It would be OK to delete that whole directory _provided_ it
is widely known that this is what will happen on purge _and_
there is an alternative place to put things that should not
be deleted on purge.
--
Thomas Hood
Reply to: