Skip to content

Instantly share code, notes, and snippets.

@puhitaku puhitaku/supervisor
Last active Jul 10, 2017

Embed
What would you like to do?
Supervisor init script for OpenWrt (procd).
#!/bin/sh /etc/rc.common
#
# AUTHOR: Takumi Sueda <puhitaku@gmail.com>
#
# Start/stop/restart supervisor in OpenWrt.
START=91
USE_PROCD=0
PROG=/usr/bin/supervisord
DAEMON=${PROG}
# Location of the pid file
PIDFILE=/tmp/supervisord.pid
# Config of supervisor
CONFIG=/etc/supervisord.conf
start_service()
{
# $DAEMON -c $CONFIG -j $PIDFILE
procd_open_instance
procd_set_param command $PROG -c $CONFIG -j $PIDFILE
procd_set_param respawn
procd_close_instance
touch $CONFIG
}
stop_service()
{
kill $(cat $PIDFILE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.