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

Re: Deleting /var/cache/*

On Tue, Sep 03, 2002 at 10:34:23PM -0400, Duncan Findlay wrote:
> I deleted /var/cache/* today to free up some space on my /var
> partition. However, instead of applications re-creating the files as I
> expected, I recieved a bunch of error messages.

> apt/apt-get refused to do anything until I manually created the
> directory /var/cache/apt/archives/partial


> Sure, these errors are relatively simple to fix, but I am wondering if
> they are bugs. So before I file them as such, I'd like to know is it a
> requirement of using /var/cache that directories and files be
> automatically re-created?
> According to FHS 5.2:
> Files located under /var/cache may be expired in an application
> specific manner, by the system administrator, or both. The application
> should always be able to recover from manual deletion of these files
> (generally because of a disk space shortage). No other requirements
> are made on the data format of the cache directories.

I think the key word is "files". As you say it doesn't talk about about
directories, for good reason since it's an awful lot of work. you'd have to

  Look for cache file
  If not, go the long way


  Look for cache file
  If not, check for parent directory
    If not there, try to create it
      If fails, check for parent directory

Ofcourse, it could just do system("mkdir -p /var/cache/whatever/dir/it/is")
everytime it wants to open a file but that would be inefficient.

> True, the FHS does not specifically say that directories have to be
> recreated, but I would consider it a bug if they aren't. Anyone agree?

Maybe in a maintainence script somewhere. IIRC squid needs to create a whole
bunch of directories for it's cache before it will start up. It does this
when you install it.

So no, I don't agree.
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> There are 10 kinds of people in the world, those that can do binary
> arithmetic and those that can't.

Reply to: