Skip to content

Instantly share code, notes, and snippets.

@przedmiot
Forked from mamemomonga/supervisord
Created October 18, 2018 10:47
Show Gist options
  • Save przedmiot/6ad6a2c69b58d3c453eae9b26020bcd8 to your computer and use it in GitHub Desktop.
Save przedmiot/6ad6a2c69b58d3c453eae9b26020bcd8 to your computer and use it in GitHub Desktop.

Revisions

  1. @mamemomonga mamemomonga revised this gist Nov 17, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion supervisord
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    #
    # Startup script for the Supervisor server
    #
    # Tested with Red Hat Enterprise Linux Server release 5.5
    # Tested with CentOS release 6.6
    #
    # chkconfig: 2345 85 15
    # description: Supervisor is a client/server system that allows its users to \
  2. @mamemomonga mamemomonga revised this gist Nov 17, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions supervisord
    Original file line number Diff line number Diff line change
    @@ -19,12 +19,12 @@ RETVAL=0
    prog="supervisord"
    SUPERVISORD=/usr/bin/supervisord
    PID_FILE=/var/run/supervisord.pid
    CONFIG=/etc/supervisord.conf
    CONFIG_FILE=/etc/supervisord.conf

    start()
    {
    echo -n $"Starting $prog: "
    $SUPERVISORD -c $CONFIG --pidfile $PID_FILE && success || failure
    $SUPERVISORD -c $CONFIG_FILE --pidfile $PID_FILE && success || failure
    RETVAL=$?
    echo
    return $RETVAL
  3. @mamemomonga mamemomonga renamed this gist Nov 17, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion gistfile1.eclass → supervisord
    Original file line number Diff line number Diff line change
    @@ -19,11 +19,12 @@ RETVAL=0
    prog="supervisord"
    SUPERVISORD=/usr/bin/supervisord
    PID_FILE=/var/run/supervisord.pid
    CONFIG=/etc/supervisord.conf

    start()
    {
    echo -n $"Starting $prog: "
    $SUPERVISORD --pidfile $PID_FILE && success || failure
    $SUPERVISORD -c $CONFIG --pidfile $PID_FILE && success || failure
    RETVAL=$?
    echo
    return $RETVAL
  4. @keimlink keimlink created this gist Feb 17, 2011.
    80 changes: 80 additions & 0 deletions gistfile1.eclass
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,80 @@
    #!/bin/bash
    #
    # Startup script for the Supervisor server
    #
    # Tested with Red Hat Enterprise Linux Server release 5.5
    #
    # chkconfig: 2345 85 15
    # description: Supervisor is a client/server system that allows its users to \
    # monitor and control a number of processes on UNIX-like \
    # operating systems.
    #
    # processname: supervisord
    # pidfile: /var/run/supervisord.pid

    # Source function library.
    . /etc/rc.d/init.d/functions

    RETVAL=0
    prog="supervisord"
    SUPERVISORD=/usr/bin/supervisord
    PID_FILE=/var/run/supervisord.pid

    start()
    {
    echo -n $"Starting $prog: "
    $SUPERVISORD --pidfile $PID_FILE && success || failure
    RETVAL=$?
    echo
    return $RETVAL
    }

    stop()
    {
    echo -n $"Stopping $prog: "
    killproc -p $PID_FILE -d 10 $SUPERVISORD
    RETVAL=$?
    echo
    }

    reload()
    {
    echo -n $"Reloading $prog: "
    if [ -n "`pidfileofproc $SUPERVISORD`" ] ; then
    killproc $SUPERVISORD -HUP
    else
    # Fails if the pid file does not exist BEFORE the reload
    failure $"Reloading $prog"
    fi
    sleep 1
    if [ ! -e $PID_FILE ] ; then
    # Fails if the pid file does not exist AFTER the reload
    failure $"Reloading $prog"
    fi
    RETVAL=$?
    echo
    }

    case "$1" in
    start)
    start
    ;;
    stop)
    stop
    ;;
    restart)
    stop
    start
    ;;
    reload)
    reload
    ;;
    status)
    status -p $PID_FILE $SUPERVISORD
    RETVAL=$?
    ;;
    *)
    echo $"Usage: $0 {start|stop|restart|reload|status}"
    RETVAL=1
    esac
    exit $RETVAL