
system to create a working .deb, based on the makefile. Adds a new script to start up the web daemon. Adds a new script to test if the database is provisioned Adds a new script used by Puppet to provision the database Adds puppet manifests (mirrored in main puppet) Moves api/ to artifice/api Alters some of the relative imports Moves artifice.py to why_is_this_called_artifice.py, as it was causing import issues. Change-Id: Id8a909f7ffcc64a5c4e3281c6b5ba83cef73b596
64 lines
1.5 KiB
Bash
64 lines
1.5 KiB
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
### BEGIN INIT INFO
|
|
# Provides: artifice
|
|
# Required-Start: $local_fs $remote_fs $network $time
|
|
# Required-Stop: $local_fs $remote_fs $network $time
|
|
# Should-Start: $syslog
|
|
# Should-Stop: $syslog
|
|
# Default-Start: 2 3 4 5
|
|
# Default-Stop: 0 1 6
|
|
# Short-Description: Artifice-Openstack billing server
|
|
### END INIT INFO
|
|
|
|
ARTIFICE_PATH=/opt/stack/artifice
|
|
DAEMON="$ARTIFICE_PATH/bin/web"
|
|
NAME=artifice
|
|
PIDFILE="/var/run/artifice/${NAME}.pid"
|
|
|
|
test -x $DAEMON || exit 0
|
|
|
|
. /lib/lsb/init-functions
|
|
|
|
# versions can be specified explicitly
|
|
case "$1" in
|
|
start)
|
|
start-stop-daemon --start --quiet --pidfile $PIDFILE\
|
|
--startas $DAEMON
|
|
;;
|
|
stop)
|
|
start-stop-daemon --stop --quiet --pidfile $PIDFILE\
|
|
--oknodo
|
|
;;
|
|
|
|
restart)
|
|
|
|
start-stop-daemon --stop --quiet --pidfile $PIDFILE --retry TERM/10/KILL/5 --quiet --oknodo
|
|
start-stop-daemon --start --quiet --pidfile $PIDFILE \
|
|
--startas $DAEMON -- $NAME
|
|
;;
|
|
|
|
status)
|
|
if [ -f $PIDFILE ]; then
|
|
|
|
PID=`cat $PIDFILE`
|
|
RUNNING=`ps aux | awk '{print $2}' | grep $PIDFILE`
|
|
|
|
if [ $RUNNING = $PID ]; then
|
|
log_success_msg "$NAME is running"
|
|
else
|
|
log_failure_msg "$NAME is not running"
|
|
fi
|
|
else
|
|
log_failure_msg "$PIDFILE not found."
|
|
fi
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|status}"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|