Re: Perhaps programs should create the subdirectories they use for their temporary files

2009-04-04 Thread Kel Modderman
On Saturday 04 April 2009 19:00:54 Guus Sliepen wrote:
 On Sat, Apr 04, 2009 at 01:54:07AM +0200, Michael Biebl wrote:
 
   contact a running daemon.  Could you explain what policykit uses /var/run
   for, and educate me a bit on why D-Bus services have to put things in
   /var/run but don't have init scripts?
  
  PolicyKit stores credentials in /var/run/PolicyKit which are of temporary 
  nature
  and are automatically cleaned up on boot.
 
 I maintain a lot of systems that run on CompactFlash cards of a few GB, but
 also have 1 or 2 GB of RAM. I mount a tmpfs over /var/cache/apt/archives, so I
 can upgrade the system without using a large amount of space on flash, and to
 prevent wear. Apt always complains about /var/cache/apt/archives/partial not
 being there, so I either have to write an init script that creates it after 
 the
 tmpfs is mounted, or (what I normally do is to) have a small script to perform
 updates, which creates the missing directories.
 
 The problem is that some programs (apt-get, PolicyKit, etc.) store temporary
 files in /var/run or /var/cache in their own subdirectories, but expect
 something else to create these directories for them. I think we should require
 these programs to create their own subdirectories at runtime. It is very 
 simple
 to add an mkdir() command to these programs. If the directory already exists,
 it is a no-op.

wpa_supplicant and hostapd do this, and saves all this bollucks about providing
an initscript for this sole purpose. Thanks for mentioning it Guus.

Thanks, Kel.


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: Perhaps programs should create the subdirectories they use for their temporary files

2009-04-04 Thread Julien Cristau
On Sat, 2009-04-04 at 11:00 +0200, Guus Sliepen wrote:
 The problem is that some programs (apt-get, PolicyKit, etc.) store temporary
 files in /var/run or /var/cache in their own subdirectories, but expect
 something else to create these directories for them. I think we should require
 these programs to create their own subdirectories at runtime. It is very 
 simple
 to add an mkdir() command to these programs. If the directory already exists,
 it is a no-op.
 
...until such a program needs to run as non-root, and then mkdir() at
runtime doesn't help anything.  /var/run/PolicyKit/ is 770
root:polkituser, probably for this reason.

Cheers,
Julien


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: Perhaps programs should create the subdirectories they use for their temporary files

2009-04-04 Thread Steve Langasek
On Sat, Apr 04, 2009 at 11:00:54AM +0200, Guus Sliepen wrote:
 I maintain a lot of systems that run on CompactFlash cards of a few GB, but
 also have 1 or 2 GB of RAM. I mount a tmpfs over /var/cache/apt/archives, so I
 can upgrade the system without using a large amount of space on flash, and to
 prevent wear. Apt always complains about /var/cache/apt/archives/partial not
 being there, so I either have to write an init script that creates it after 
 the
 tmpfs is mounted, or (what I normally do is to) have a small script to perform
 updates, which creates the missing directories.
 
 The problem is that some programs (apt-get, PolicyKit, etc.) store temporary
 files in /var/run or /var/cache in their own subdirectories, but expect
 something else to create these directories for them. I think we should require
 these programs to create their own subdirectories at runtime. It is very 
 simple
 to add an mkdir() command to these programs. If the directory already exists,
 it is a no-op.

  /var/cache is intended for cached data from applications. Such data is
  locally generated as a result of time-consuming I/O or calculation. The
  application must be able to regenerate or restore the data. Unlike
  /var/spool, the cached files can be deleted without data loss. The data
  must remain valid between invocations of the application and rebooting the
  system.

  Files located under /var/cache may be expired in an application specific
  manner, by the system administrator, or both. The application must 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.

apt only uses /var/cache, which the *system* is expected to preserve across
reboots.  If apt isn't able to recreate these directories at runtime, that's
an apt bug, yes; but if you don't preserve /var/cache across reboots, that's
arguably a bug in your configuration, since /var/cache is supposed to be
preserved just as /var/lib in the default case.

-- 
Steve Langasek   Give me a lever long enough and a Free OS
Debian Developer   to set it on, and I can move the world.
Ubuntu Developerhttp://www.debian.org/
slanga...@ubuntu.com vor...@debian.org


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org