Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add init script for supervisord

  • Loading branch information...
commit 289538c7363111fa7023cbd8ddb275f7e8d92272 1 parent 0383427
TAGOMORI Satoshi authored

Showing 1 changed file with 67 additions and 0 deletions. Show diff stats Hide diff stats

  1. +67 0 supervisord_init
67 supervisord_init
... ... @@ -0,0 +1,67 @@
  1 +#!/bin/bash
  2 +#
  3 +# /etc/rc.d/init.d/supervisord
  4 +# supervisord This shell script takes care of starting and stopping
  5 +# supervisord. Tested on Fedora 11.
  6 +#
  7 +# Author: Brian Bouterse bmbouter@gmail.com
  8 +#
  9 +# chkconfig: 345 80 80
  10 +# description: supervisord is a client/server process control system. \
  11 +# processname: supervisord
  12 +# pidfile: /var/run/supervisord.pid
  13 +
  14 +# Source function library.
  15 +. /etc/init.d/functions
  16 +
  17 +DAEMON=/usr/bin/supervisord
  18 +PIDFILE=/var/run/supervisord.pid
  19 +
  20 +# Exit if the package is not installed
  21 +[ -x "$DAEMON" ] || exit 0
  22 +
  23 +start() {
  24 + echo -n "Starting supervisord: "
  25 + if [ -f $PIDFILE ]; then
  26 + PID=`cat $PIDFILE`
  27 + echo supervisord already running: $PID
  28 + exit 2;
  29 + else
  30 + daemon $DAEMON --pidfile=$PIDFILE
  31 + RETVAL=$?
  32 + echo
  33 + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/supervisord
  34 + return $RETVAL
  35 + fi
  36 +
  37 +}
  38 +
  39 +stop() {
  40 + echo -n "Shutting down supervisord: "
  41 + echo
  42 + killproc -p $PIDFILE supervisord
  43 + echo
  44 + rm -f /var/lock/subsys/supervisord
  45 + return 0
  46 +}
  47 +
  48 +case "$1" in
  49 + start)
  50 + start
  51 + ;;
  52 + stop)
  53 + stop
  54 + ;;
  55 + status)
  56 + status supervisord
  57 + ;;
  58 + restart)
  59 + stop
  60 + start
  61 + ;;
  62 + *)
  63 + echo "Usage: {start|stop|status|restart}"
  64 + exit 1
  65 + ;;
  66 +esac
  67 +exit $?

0 comments on commit 289538c

Please sign in to comment.
Something went wrong with that request. Please try again.