Fixed version of oslo.rootwrap
[openstack-build/ceilometer-build.git] / xenial / debian / ceilometer-agent-compute.init
index 1429ed4b6dcc900f8f2c91e834d78d5f52bf930c..0b9ef939d7c1b2cffb9356de06b529c6d743cbb8 100644 (file)
@@ -3,6 +3,8 @@
 # Provides:          ceilometer-agent-compute
 # Required-Start:    $network $local_fs $remote_fs $syslog
 # Required-Stop:     $remote_fs
+# Should-Start:      mongodb rabbitmq-server
+# Should-Stop:       mongodb rabbitmq-server
 # Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: ceilometer central compute
@@ -16,8 +18,6 @@ DESC="Ceilometer Agent Compute"
 SYS_NAME=ceilometer
 NAME=ceilometer-agent-compute
 DAEMON=/usr/bin/ceilometer-agent-compute
-DAEMON_ARGS="--config-file /etc/nova/nova.conf"
-[ -f '/etc/nova/nova-compute.conf' ] && DAEMON_ARGS=${DAEMON_ARGS}" --config-file=/etc/nova/nova-compute.conf"
 
 SCRIPTNAME=/etc/init.d/${NAME}
 DAEMON_USER=${SYS_NAME}
@@ -25,6 +25,8 @@ DAEMON_GROUP=${SYS_NAME}
 LOCK_DIR=/var/lock/${SYS_NAME}
 PID_DIR=/var/run/${SYS_NAME}
 PID_FILE=${PID_DIR}/${NAME}.pid
+LOGFILE=/var/log/${SYS_NAME}/${NAME}.log 
+DAEMON_ARGS="--config-file=/etc/${SYS_NAME}/ceilometer.conf"
 
 [ -x $DAEMON ] || exit 0
 
@@ -35,6 +37,12 @@ done
 
 . /lib/lsb/init-functions
 
+[ -r /etc/default/openstack ] && . /etc/default/openstack
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+[ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+[ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file=$LOGFILE"
+
 do_start() {
        start-stop-daemon --start \
                        --background --quiet \