I have a tiny Catalyst project that I want to eventually deploy using the POE engine in pre-forked mode, to replace a mod_perl app. The app uses the apache rotatelogs utility, for which unfortunately there is no direct Perl replacement (yet).

I wanted something like an apachectl utility to control the server. Here's what I came up with.

You can use either the rotatelogs binary from apache (just put into MyApp/bin) or compile the one attached (dependency on apache include files has been removed.)

Configuration (in your myapp.yml) is something like this:

name: MyApp
catalyst_engine: 'HTTP::POE'
poe_max_proc: 6
# host: localhost
port: 3000
keepalive: 1
log_dir: '~/logs/myapp'
# Put a link or copy of Apache's rotatelogs into MyApp/bin.
# See man rotatelogs for details about the format.
rotatelogs_format: 'myapp_ui_log.%Y-%m-%d-%H 3600 -480'

Edit the myappctl.pl a bit, at least so that it loads the right config file.

Then just run script/myappctl.pl start|stop|restart

Caelum@freenode & irc.perl.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: myappctl.pl
Type: application/octet-stream
Size: 3174 bytes
Desc: myappctl.pl
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071008/f34e9a60/myappctl.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotatelogs.c
Type: application/octet-stream
Size: 5855 bytes
Desc: rotatelogs.c
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071008/f34e9a60/rotatelogs.obj

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedOct 8, '07 at 3:28p
activeOct 8, '07 at 3:28p

1 user in discussion

Rafael Kitover: 1 post



site design / logo © 2022 Grokbase