Skip to content

Instantly share code, notes, and snippets.

View ideaoforder's full-sized avatar

Mark Dickson ideaoforder

  • Sitesteaders Developement
View GitHub Profile
check process starling_22122 with pidfile YOUR_WEB_APP/pids/starling_22122.pid
start program = "/home/YOUR_USER/scripts/starling start 22122"
stop program = "/home/YOUR_USER/scripts/starling stop 22122"
if cpu > 80% for 5 cycles then restart
if failed port 22122 with timeout 10 seconds then restart
if 3 restarts within 5 cycles then timeout
mode active
group YOUR_APP_NAME
check process workling0 with pidfile YOUR_WEB_APP/log/workling0.pid
group YOUR_APP_NAME
start program = "/home/YOUR_USER/scripts/workling start 0"
stop program = "/home/YOUR_USER/scripts/workling stop 0"
if totalmem > 60 Mb then restart
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if loadavg(5min) greater than 10 for 8 cycles then restart
if 3 restarts within 5 cycles then timeout
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: starling
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop starling server
### END INIT INFO
#
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: workling
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop worklings
### END INIT INFO
#
#!/bin/sh -e
# starling This init.d script is used to start starling.
# It basically just calls starling.
ENV="env -i LANG=C PATH=/usr/local/bin:/usr/bin:/bin"
set -e
if [ -x /usr/bin/starling ] ; then
HAVE_STARLING=1
else
#!/bin/sh -e
# workling This init.d script is used to start workling.
# It basically just calls workling.
. /lib/lsb/init-functions
ROOT="YOUR_WEB_APP"
PID=$ROOT"log/workling$2.pid"
WORKLING=$ROOT"script/workling_client"
START_COMMAND=$WORKLING" start"
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.
namespace :deploy do
task :start do
restart_monit
sudo "monit -g #{application} start all"
START WEB SERVER (mongrels, thins, litespeed, whatever)
end
task :stop do
restart_monit
// NOTE: We have to replace the 'releases/xxxx' folder with 'current'
define('FCPATH', preg_replace('/releases\/\d*\//', 'current/', __FILE__));
// When animation starts
ExternalInterface.call('js_get_flash_val', [animationName], 'start');
// When animation finishes
ExternalInterface.call('js_get_flash_val', [animationName], 'finish');