4
# Required-Start: $network $local_fs $remote_fs $syslog
5
# Required-Stop: $remote_fs
6
# Default-Start: 2 3 4 5
8
# Short-Description: Heat API
9
# Description: Heat API server
12
# Author: Thomas Goirand <zigo@debian.or>
14
# PATH should only include /usr/* if it runs after the mountnfs.sh script
15
PATH=/sbin:/usr/sbin:/bin:/usr/bin
18
DAEMON=/usr/bin/heat-api
19
PIDFILE=/var/run/$NAME.pid
20
SCRIPTNAME=/etc/init.d/$NAME
23
# Exit if the package is not installed
24
[ -x $DAEMON ] || exit 0
26
. /lib/lsb/init-functions
28
if [ ! -e /var/log/heat ] ; then
29
mkdir -p /var/log/heat
30
chown ${SYSTEM_USER} /var/log/heat
34
start-stop-daemon --start --background --quiet --chuid ${SYSTEM_USER}:${SYSTEM_USER} --make-pidfile --pidfile $PIDFILE --startas $DAEMON --test > /dev/null || return 1
35
start-stop-daemon --start --background --quiet --chuid ${SYSTEM_USER}:${SYSTEM_USER} --make-pidfile --pidfile $PIDFILE --startas $DAEMON || return 2
39
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE
47
log_daemon_msg "Starting $DESC" "$NAME"
55
log_daemon_msg "Stopping $DESC" "$NAME"
63
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
66
log_daemon_msg "Restarting $DESC" "$NAME"
73
1) log_end_msg 1 ;; # Old process is still running
74
*) log_end_msg 1 ;; # Failed to start
84
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2