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.
89e7c8b162c71e9905fbfe7d2ec376dc?d=identicon&s=25 Fernando Blat (Guest)
on 2006-01-23 17: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 Blat
Ad7805c9fcc1f13efc6ed11251a6c4d2?d=identicon&s=25 Alex Young (Guest)
on 2006-01-23 18:02
(Received via mailing list)
Fernando Blat 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
132a94ca65959bda6c74fae54bff2425?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-01-23 19:43
(Received via mailing list)
On Jan 23, 2006, at 1:49 AM, Fernando Blat wrote:

>
> Any suggestion or personal experience?
>
> --
>
> Fernando Blat
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> 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 Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra@yakima-herald.com
6559f9b9607a89074ea5e238d31ffbc2?d=identicon&s=25 Kelly Dwight Felkins (Guest)
on 2006-01-23 20: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
89e7c8b162c71e9905fbfe7d2ec376dc?d=identicon&s=25 Fernando Blat (Guest)
on 2006-01-23 20: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 Felkins <railsinator@gmail.com>:
> -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
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>


--
Fernando Blat
132a94ca65959bda6c74fae54bff2425?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-01-23 20: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 Felkins 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
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails

-Ezra Zygmuntowicz
Yakima Herald-Republic
WebMaster
http://yakimaherald.com
509-577-7732
ezra@yakima-herald.com
81194a50c0f9bd95d7832a77fdf371bd?d=identicon&s=25 csn (Guest)
on 2006-01-23 21:10
Ezra Zygmuntowicz 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
89e7c8b162c71e9905fbfe7d2ec376dc?d=identicon&s=25 Fernando (Guest)
on 2006-01-29 15:21
Ezra Zygmuntowicz 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.
89e7c8b162c71e9905fbfe7d2ec376dc?d=identicon&s=25 Fernando Blat (Guest)
on 2006-02-14 08: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 <ferblape@gmail.com>:
> > Cheers-
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
Fernando Blat
This topic is locked and can not be replied to.