[Catalyst] daemon for POE backend with rotatelogs support

Rafael Kitover rkitover at walmart.com
Mon Oct 8 15:28:16 GMT 2007


I have a tiny Catalyst project that I want to eventually deploy using the P=
OE engine in pre-forked mode, to replace a mod_perl app. The app uses the a=
pache rotatelogs utility, for which unfortunately there is no direct Perl r=
eplacement (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/b=
in) or compile the one attached (dependency on apache include files has bee=
n 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 at 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/f34e=
9a60/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/f34e=
9a60/rotatelogs.obj


More information about the Catalyst mailing list