
Use oslo.rootwrap to replace the default root_helper sudo. Change-Id: I5875cd647a4cc4f60f3058a98ea8a829cf056c43 Implements: blueprint astara-rootwrap
48 lines
1.1 KiB
Bash
Executable File
48 lines
1.1 KiB
Bash
Executable File
#! /bin/sh
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: astara-router-api-server
|
|
# Required-Start: $all
|
|
# Required-Stop: $all
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop:
|
|
# Short-Description: Astara Router API Server
|
|
### END INIT INFO
|
|
|
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
DAEMON="/usr/bin/gunicorn"
|
|
NAME="astara-router-api-server"
|
|
OPTIONS="--user gunicorn --pythonpath /usr/local/share/astara -c /etc/astara_gunicorn_config.py astara_router.api.server:app"
|
|
PIDFILE=/var/run/gunicorn.pid
|
|
|
|
test -x $DAEMON || exit 0
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
case "$1" in
|
|
start)
|
|
log_daemon_msg "Starting astara-router-api-server" $NAME
|
|
start_daemon -p $PIDFILE $DAEMON $OPTIONS
|
|
log_end_msg $?
|
|
;;
|
|
stop)
|
|
log_daemon_msg "Stopping astara-router-api-server" $NAME
|
|
killproc -p $PIDFILE $DAEMON
|
|
log_end_msg $?
|
|
;;
|
|
force-reload|restart)
|
|
$0 stop
|
|
$0 start
|
|
;;
|
|
status)
|
|
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
|
|
;;
|
|
*)
|
|
echo "Usage: /etc/init.d/astara-router-api-server {start|stop|restart|force-reload|status}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|