Forum: Ruby on Rails OT: Problem rotating logs with lighttpd

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fernando B. (Guest)
on 2006-01-23 18:44
(Received via mailing list)
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.
Alex Y. (Guest)
on 2006-01-23 19:02
(Received via mailing list)
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
Ezra Z. (Guest)
on 2006-01-23 20:43
(Received via mailing list)
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
Kelly Dwight F. (Guest)
on 2006-01-23 21:10
(Received via mailing list)
I installed lighttpd using a debian package from here:


http://apt.utsl.gen.nz/debian/pool/sarge-i386/ligh...


(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
Fernando B. (Guest)
on 2006-01-23 21:22
(Received via mailing list)
Thanks for your answers (and sorry for my English).

Tomorrow we'll test that and I'll tell you if it works :)

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.
Ezra Z. (Guest)
on 2006-01-23 21:35
(Received via mailing list)
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
csn (Guest)
on 2006-01-23 22:10
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
Fernando (Guest)
on 2006-01-29 16:21
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.
Fernando B. (Guest)
on 2006-02-14 09:28
(Received via mailing list)
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.
This topic is locked and can not be replied to.