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]

  respawn
  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 127.0.0.1:8088 --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.


-dave

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

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to