0

I'm running lighttpd on a Debian Lenny host. My lighttpd version has a bug where it doesn't recreate its compress.cache-dir on startup (I have it set to use /tmp/lighttpdcompress/). As a result, on reboot, lighttpd fails to start. What can I do to have the system recreate this directory before it runs lighty's init script?

Thanks to all! I'm switching to a directory under /var/tmp to sidestep the problem.

3 Answers3

5

Either modify your startup script to create it if it doesn't exist, or use a directory structure that won't get blasted at reboot time, like /var/tmp.

David Mackintosh
  • 14,223
  • 6
  • 46
  • 77
  • David, maybe add that this startup work could be done in /etc/rc.local – kbyrd Jun 01 '09 at 03:30
  • 1
    While possible, I disagree from a bit of a philosophical standpoint. Since the directory is necessary for the service to run, the initfile for that service should be responsible for creating it if it doesn't exist. Spreading things around in multiple files is a recipe for forgetting dependencies. – David Mackintosh Jun 02 '09 at 01:13
1

/tmp is cleared every reboot. /var/tmp is not.

Use /var/tmp instead, it's the convention

Rich
  • 945
  • 1
  • 6
  • 15
0

I can't up vote or comment at the moment, but I agree with David Mackintosh's answer. Just edit the init script for lighttpd to add "mkdir /tmp/lighttpdcompress' command. I have not looked a the script, but make sure you put the command in just before the execution of the lighttpd daemon statement.

pulcher
  • 336
  • 1
  • 4