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

Re: NEVER remove log files without asking



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Jamin W. Collins" <jcollins@asgardsrealm.net> writes:

> On Mon, Aug 16, 2004 at 03:57:45PM -0500, Steve Greenland wrote:
>>
>> It seems a lot easier to say "Hey, admin person: when a package
>> creates a subdir of /var/log, you can expect it to remove everything
>> under it when it's purged; adjust your configuration and expectations
>> accordingly" than "well, you need to read the package's postrm to
>> determine what file names it might leave around when it's purged."
>
> 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?

This depends on the context, IMHO.  For example, when I purge a print
spooler, I would like /var/spool/xxxx removed.  For a mail or news
server, this is possibly bad--I might install a different one which
could re-use the news/mail spool, which tend to be able to use common
spool formats.

In the case of dosemu, this recommended you to install your operating
system and data under /var/lib/dosemu.  I lost 4 GiB filesystem when I
purged dosemu and it rm -rfed the lot.  Is this valid?  Possibly, but
I only followed the docs.  If this docs had said "put your data
elsewhere and create a symlink", everything would have been fine.
This was not documented however.  Nowadays I know better, but severe
data loss after following the documented procedures is not on--and the
then maintainer refused to fix it.

Nowadays, I would suggest that packages /do/ assume that these
directories are entirely under their ownership.  Anything that also
wants to put data under them should be packaged and that package
should depend upon it.  For example, extensions to a package should
depend on that package.  This then allows the main package to freely
purge the directories on removal.

*Site-specific data not under package management belongs under /srv*.

For many locations, the correct behaviour will depend on how it has
been used historically.  If there is a history of putting local data
somewhere e.g. /var/cvs, /var/mail, then purging it would be bad.  For
all other locations, including /var/log, I can't see a problem.  If I
remove a package, I no longer care about its logs.  If I did, I would
have made a copy beforehand.

> 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.

With the availability of /srv, there's no reason /not/ to be certain.


Regards,
Roger

- -- 
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8 <http://mailcrypt.sourceforge.net/>

iD8DBQFBImCpVcFcaSW/uEgRAsQMAKDB9tQ3wzN3OllfsfwirLuTLBL/IQCg8iWD
bvo4+00o86o2S45FFBF53as=
=Hl5U
-----END PGP SIGNATURE-----



Reply to: