[Catalyst] upstart script for Starman-based app?

Dave Rolsky autarch at urth.org
Thu May 3 22:45:27 GMT 2012

On Thu, 3 May 2012, Octavian Rasnita wrote:

> Does anyone have an upstart script that can be used for automaticly starting a Cat app using Starman?
> I use Perlbrew and local::lib and I start the app in my own account and not as root and I don't know how to make upstart start the app under my account.
> Maybe it will be helpful to see an upstart script that works, and try to adapt it.

Here's an upstart script I use for vegguide.org. Note that I have root 
access to my server, so you'll need to adjust a bit.

   description "VegGuide starman server"

   start on (local-filesystems and net-device-up IFACE!=lo)
   stop on runlevel [016]

   limit as 524288000 524288000

   pre-start script
       mkdir -p /var/run/vegguide
       chown www-data:www-data /var/run/vegguide

       mkdir -p /var/log/vegguide
       chown www-data:www-data /var/log/vegguide
   end script

   exec /opt/perl5.14.2-no-threads/bin/starman --listen --workers 12 --preload-app --user www-data --group www-data /opt/perl5.14.2-no-threads/bin/vegguide.psgi 2>> /var/log/vegguide/error.log

This code base is in a git repo at git://git.urth.org/VegGuide.git

I also have a log monitor script which was watches this error log and 
emails me when there are errors. I start that via upstart too, and it's 
dependent on this job.


http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)

More information about the Catalyst mailing list