usualoma
8/22/2012 - 4:44 AM

movable type config file for upstart

movable type config file for upstart

description "Movable Type"

start on runlevel [2345] or mysql
stop on runlevel [!2345]

respawn
respawn limit 2 5

env PLACK_ENV=deployment
env MT_HOME=/home/movabletype/public_html/movabletype
env MT_CONFIG=/home/movabletype/public_html/movabletype/mt-config.cgi

script
    port="5000"
    user="movabletype"
    group="movabletype"
    pidfile=`perl -ne 'next if /^#/; print $1 if /^\s*PIDFilePath\s+(.*)/i' ${MT_CONFIG}`

    exec /usr/bin/starman --user $user --group $user --pid $pidfile ${MT_HOME}/mt.psgi -p $port
end script