3 # Provides: ceilometer-agent-compute
4 # Required-Start: $network $local_fs $remote_fs $syslog
5 # Required-Stop: $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: ceilometer central compute
9 # Description: ceilometer central compute
12 # Author: Thomas Goirand <zigo@debian.org>
14 PATH=/sbin:/usr/sbin:/bin:/usr/bin
15 DESC="Ceilometer Agent Compute"
17 NAME=ceilometer-agent-compute
18 DAEMON=/usr/bin/ceilometer-agent-compute
20 SCRIPTNAME=/etc/init.d/${NAME}
21 DAEMON_USER=${SYS_NAME}
22 DAEMON_GROUP=${SYS_NAME}
23 LOCK_DIR=/var/lock/${SYS_NAME}
24 PID_DIR=/var/run/${SYS_NAME}
25 PID_FILE=${PID_DIR}/${NAME}.pid
27 [ -x $DAEMON ] || exit 0
29 for i in ${LOCK_DIR} ${PID_DIR} ; do
30 [ ! -d ${i} ] && mkdir -p ${i}
31 [ -d ${i} ] && chown ${DAEMON_USER}:${DAEMON_GROUP} ${i}
34 . /lib/lsb/init-functions
37 start-stop-daemon --start \
38 --background --quiet \
39 --chuid ${DAEMON_USER}:${DAEMON_GROUP} \
40 --make-pidfile --pidfile ${PID_FILE} \
45 start-stop-daemon --start \
46 --background --quiet \
47 --chuid ${DAEMON_USER}:${DAEMON_GROUP} \
48 --make-pidfile --pidfile ${PID_FILE} \
50 --startas $DAEMON -- $DAEMON_ARGS \
55 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PID_FILE
63 log_daemon_msg "Starting $DESC" "$NAME"
71 log_daemon_msg "Stopping $DESC" "$NAME"
79 status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
82 log_daemon_msg "Restarting $DESC" "$NAME"
89 1) log_end_msg 1 ;; # Old process is still running
90 *) log_end_msg 1 ;; # Failed to start
93 *) log_end_msg 1 ;; # Failed to stop
97 echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2