Instantly share code, notes, and snippets.

@puhitaku /driver
Last active May 15, 2016

Embed
What would you like to do?
Physical Router Driver init script
#!/bin/sh /etc/rc.common
# AUTHOR: Takumi Sueda <puhitaku@gmail.com>
START=92
USE_PROCD=1
PROG=/usr/bin/gunicorn
DAEMON=${PROG}
# Location of the pid file
PIDFILE=/tmp/gunicorn.pid
start_service()
{
procd_open_instance
procd_set_param command $PROG --chdir /root/physical_router_driver -b 0.0.0.0:80 -p $PIDFILE main:app
procd_close_instance
}
stop_service()
{
kill $(cat $PIDFILE)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment