Here is my supervisord init script.  not sure if its the best but its 
working

Noah Gift wrote:
>
>
> On Sun, Mar 29, 2009 at 1:05 PM, Mike Orr <[email protected] 
> <mailto:[email protected]>> wrote:
>
>
>     On Sat, Mar 28, 2009 at 4:42 PM, jose <[email protected]
>     <mailto:[email protected]>> wrote:
>     > So this brings me to the heart of what I've learned, if you are
>     going
>     > to deploy a long running app how do you do it?
>
>     I put all my Pylons and Quixote apps under Supervisord, with Apache
>     mod_proxy.  I want to try nginx when I have a chance.
>
>     Some people prefer mod_wsgi because it runs everything under Apache
>     processes, but I like being able to "supervisor stop" and "supervisor
>     start" individual applications for maintenance and debugging, plus
>     seeing them under their own names in the ps listing.
>
>
> This recently came up at work, at one other gotcha is that you have to 
> write your own init script.  Is there a recipe on the Pylons wiki for 
> this?
>  
>
>
>
>     --
>     Mike Orr <[email protected] <mailto:[email protected]>>
>
>
>
>
>
> -- 
> Cheers,
>
> Noah
>
> >

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

#! /bin/sh
### BEGIN INIT INFO
# Provides:          skeleton
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Supervisord initscript
### END INIT INFO

# Author: Jose Galvez

# Do NOT "set -e"

# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Supervisor service Deamon"
NAME=supervisord
DAEMON=/usr/bin/$NAME
DAEMON_ARGS=""
DAEMON_CTl=/usr/bin/supervisorctl
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0

# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME

# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh

# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions

#
# Function that starts the daemon/service
#
do_start()
{
        $DAEMON
}

#
# Function that stops the daemon/service
#
do_stop()
{
        $DAEMON_CTl shutdown
}

#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() 
{
        $DAEMON_CTl reload
}

do_status()
{
        $DAEMON_CTl status
}

case "$1" in
  start)
        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
        do_start
        ;;
  stop)
        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
        do_stop
        ;;
  reload)
        do_reload
        ;;
  restart)
        #
        # If the "reload" option is implemented then remove the
        # 'force-reload' alias
        #
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
        do_start
        ;;
  status)
        do_status
        ;;
  *)
        #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
        echo "Usage: $SCRIPTNAME {start|stop|restart|reload|status}" >&2
        exit 3
        ;;
esac

:

Reply via email to