On 3/28/09, Jose Galvez <[email protected]> wrote:
> Here is my supervisord init script.  not sure if its the best but its
> working

This script looks like it's for Red Hat; here's one for Ubuntu.  Start
works and stop works, but restart doesn't for some reason, so I have
to start it again after restarting.

As for supervisord spontaneously crashing and needing to be
relaunched; I've never seen it happen.

By the way, the easiest way to make an init script is to copy an
existing minimal one.

===
#! /bin/bash -e

# /etc/init.d/supervisor: start and stop the Supervisor daemon manager

#SUPERVISORD=/usr/local/bin/supervisord
#SUPERVISORCTL=/usr/local/bin/supervisorctl

SUPERVISORD=/usr/local/venv-supervisor/bin/supervisord
SUPERVISORCTL=/usr/local/venv-supervisor/bin/supervisorctl
PIDFILE=/var/run/supervisord.pid
OPTS="-c /etc/supervisord.conf"

test -x $SUPERVISORD || exit 0

. /lib/lsb/init-functions

export PATH="${PATH:+$PATH:}/usr/local/bin:/usr/sbin:/sbin"

start () {
        log_begin_msg "Starting Supervisor daemon manager..."
        $SUPERVISORD $OPTS || log_end_msg 1
        log_end_msg 0
}

stop () {
        log_begin_msg "Stopping Supervisor daemon manager..."
        $SUPERVISORCTL shutdown || log_end_msg 1
        log_end_msg 0
}

case "$1" in
  start)
    start
        ;;

  stop)
    stop
        ;;

  restart|reload|force-reload)
    stop
    start
    ;;

esac

exit 0
===

-- 
Mike Orr <[email protected]>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to