OT: Problem rotating logs with lighttpd


#1

Hi everybody,

this is a little OT. We are using Lighttpd as a webserver for Rails.
Our problem is that when we rotate the logs everyday at the end of the
process, lighttpd stops writing the logs. To solve this we have to
restart the server manually each time.

We use a common Debian, lighttpd-1.4.7, Rails 1.0 and fcgi-2.4.0.

I have tracked the lighttpd bugs, and I haven’t found anything.

Any suggestion or personal experience?


Fernando B.


#2

Fernando B. wrote:

Any suggestion or personal experience?

It’s not something I’ve come across personally, but this seems relevant:

http://article.gmane.org/gmane.comp.web.lighttpd/3211


#3

On Jan 23, 2006, at 1:49 AM, Fernando B. wrote:

Any suggestion or personal experience?

Fernando B.


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

Fernando-

The way I get around this is a custom script that first copies the

log file to a backup dir and tar.gzips it. And then instead of
deleting the log and making a new on, all I do is this:

$ echo ‘’ > lighttpd_access.log

That way the same log file gets used but you just make it empty

instead of replacing it.

Cheers-
-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid


#4

I installed lighttpd using a debian package from here:

http://apt.utsl.gen.nz/debian/pool/sarge-i386/lighttpd_1.4.5-1_i386.deb

(Suggested by the great folks at Rimu Hosting).

This installs lighttpd consistent with debian standards. So, log rotate
runs
and rotates the logs just fine.

-Kelly


#5

Thanks for your answers (and sorry for my English).

Tomorrow we’ll test that and I’ll tell you if it works :slight_smile:

2006/1/23, Kelly Dwight F. removed_email_address@domain.invalid:

-Kelly

Our problem is that when we rotate the logs everyday at the end of the

log file to a backup dir and tar.gzips it. And then instead of
Yakima Herald-Republic
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Fernando B.


#6

Ezra Z. wrote:

The way I get around this is a custom script that first copies the
log file to a backup dir and tar.gzips it. And then instead of
deleting the log and making a new on, all I do is this:

$ echo ‘’ > lighttpd_access.log

That way the same log file gets used but you just make it empty
instead of replacing it.

Is there a way to do that without fear of losing lines placed in the log
since the copy? Granted at 2 AM there probably wouldn’t be many (except
for robots).

csn


#7

There is a more current lighttpd.deb file that bougyman maintains.
Last time I checked it was at version 1.4.8 and includes all the
debian specific stuff. Just do the follwing:

$ sudo echo “deb http://debian.bougyman.com unstable main” >> /etc/
apt/sources.list
$ sudo apt-get update
$ sudo apt-get install lighttpd

Cheers-
-Ezra

On Jan 23, 2006, at 11:09 AM, Kelly Dwight F. wrote:

restart the server manually each time.


deleting the log and making a new on, all I do is this:
Yakima Herald-Republic
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails

-Ezra Z.
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
removed_email_address@domain.invalid


#8

After some days I come back with this topic again, because I have
found this two links:

http://trac.lighttpd.net/trac/ticket/404

http://trac.lighttpd.net/trac/wiki/MigratingFromApache

So, maybe the problem is that Lighttpd doesn’t handle the SIGHUP
signal, so it stops writting the logs and, maybe, the solution is to
use the lighttpd Debian package or use cronolog instead of logrotate.

2006/1/29, Fernando removed_email_address@domain.invalid:

Cheers-
removed_email_address@domain.invalid
http://lists.rubyonrails.org/mailman/listinfo/rails


Fernando B.


#9

Ezra Z. wrote:

There is a more current lighttpd.deb file that bougyman maintains.
Last time I checked it was at version 1.4.8 and includes all the
debian specific stuff. Just do the follwing:

$ sudo echo “deb http://debian.bougyman.com unstable main” >> /etc/
apt/sources.list
$ sudo apt-get update
$ sudo apt-get install lighttpd

Cheers-
-Ezra

We’ll try that version.

Now, the problem begins after the logrotate rotates the logs.