astara-appliance/scripts/etc/init.d/metadata
2015-04-08 16:44:51 -04:00

48 lines
968 B
Bash
Executable File

#! /bin/sh
### BEGIN INIT INFO
# Provides: metadata
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Akanda OpenStack Metadata Service
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON="/usr/local/bin/akanda-metadata-proxy"
NAME="akanda-metadata-proxy"
OPTIONS="/etc/metadata.conf"
PIDFILE=/var/run/metadata.pid
test -x $DAEMON || exit 0
. /lib/lsb/init-functions
case "$1" in
start)
log_daemon_msg "Starting $NAME" $NAME
start_daemon -p $PIDFILE $DAEMON $OPTIONS
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $NAME" $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/akanda-metadata-proxy {start|stop|restart|force-reload|status}"
exit 1
;;
esac
exit 0