Skip to content

Instantly share code, notes, and snippets.

@puhitaku
Last active May 15, 2016 07:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save puhitaku/8fbdf5a39899041a85ae936f124f58de to your computer and use it in GitHub Desktop.
Save puhitaku/8fbdf5a39899041a85ae936f124f58de to your computer and use it in GitHub Desktop.
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