49 lines
622 B
Bash
49 lines
622 B
Bash
#!/bin/bash
|
|
|
|
run_supervisord()
|
|
{
|
|
/usr/bin/supervisord -c /etc/supervisord.conf "${@}"
|
|
}
|
|
|
|
run_supervisorctl()
|
|
{
|
|
/usr/bin/supervisorctl -c /etc/supervisord.conf "${@}"
|
|
}
|
|
|
|
supervisord_start()
|
|
{
|
|
echo "Starting supervisord..."
|
|
run_supervisord
|
|
}
|
|
|
|
supervisord_stop()
|
|
{
|
|
echo "Stopping supervisord..."
|
|
run_supervisorctl shutdown
|
|
}
|
|
|
|
supervisord_restart()
|
|
{
|
|
echo "Restarting supervisord..."
|
|
run_supervisorctl reload
|
|
}
|
|
|
|
case "${1}" in
|
|
start)
|
|
supervisord_start
|
|
;;
|
|
|
|
stop)
|
|
supervisord_stop
|
|
;;
|
|
|
|
restart)
|
|
supervisord_restart
|
|
;;
|
|
|
|
*)
|
|
echo "Usage: ${0} {start|stop|restart}"
|
|
exit 1
|
|
;;
|
|
esac
|