[PKG-Openstack-devel] [PATCH] Allow selecting log destination for Ceilometers daemons
Sylvain Baubeau
sylvain.baubeau at enovance.com
Tue Apr 8 12:48:59 UTC 2014
Sorry, I made a mistake in two Upstart files.
Please use the attached patches of this mail, one for debian/havana and one for debian/icehouse
Regards,
Sylvain
----- Mail original -----
De: "Sylvain Baubeau" <sylvain.baubeau at enovance.com>
À: openstack-devel at lists.alioth.debian.org
Envoyé: Lundi 7 Avril 2014 18:42:57
Objet: [PKG-Openstack-devel] [PATCH] Allow selecting log destination for Ceilometers daemons
Greetings,
Sylvain Baubeau
commit 11ff486f418564ab6651a37b73ceaf1282242e71
Author: Sylvain Baubeau <sylvain.baubeau at enovance.com>
Date: Mon Apr 7 17:09:37 2014 +0200
Allow selecting log destination for Ceilometer daemons
diff --git a/debian/ceilometer-agent-central.init b/debian/ceilometer-agent-central.init
index 3d1985a..811b430 100644
--- a/debian/ceilometer-agent-central.init
+++ b/debian/ceilometer-agent-central.init
@@ -26,7 +26,7 @@ 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 --log-file=$LOGFILE"
+DAEMON_ARGS="--config-file=/etc/${SYS_NAME}/ceilometer.conf"
[ -x $DAEMON ] || exit 0
@@ -37,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 \
diff --git a/debian/ceilometer-agent-central.upstart.in b/debian/ceilometer-agent-central.upstart.in
index d18092a..44319bd 100644
--- a/debian/ceilometer-agent-central.upstart.in
+++ b/debian/ceilometer-agent-central.upstart.in
@@ -14,4 +14,12 @@ pre-start script
chown ceilometer:ceilometer /var/lock/ceilometer
end script
-exec su -s /bin/sh -c "exec ceilometer-agent-central --config-file /etc/ceilometer/ceilometer.conf --log-file /var/log/ceilometer/ceilometer-agent-central.log" ceilometer
+script
+ [ -r /etc/default/openstack ] && . /etc/default/openstack
+ [ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+ [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+ [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file /var/log/ceilometer/$UPSTART_JOB.log"
+
+ exec su -s /bin/sh -c "exec ceilometer-agent-central --config-file /etc/ceilometer/ceilometer.conf $DAEMON_ARGS" ceilometer
+end script
diff --git a/debian/ceilometer-agent-compute.init b/debian/ceilometer-agent-compute.init
index 5b7da4b..dfcbfe7 100644
--- a/debian/ceilometer-agent-compute.init
+++ b/debian/ceilometer-agent-compute.init
@@ -26,7 +26,7 @@ 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 --log-file=$LOGFILE"
+DAEMON_ARGS="--config-file=/etc/${SYS_NAME}/ceilometer.conf"
[ -x $DAEMON ] || exit 0
@@ -37,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 \
diff --git a/debian/ceilometer-agent-compute.upstart.in b/debian/ceilometer-agent-compute.upstart.in
index c37f5c8..de8c2ca 100644
--- a/debian/ceilometer-agent-compute.upstart.in
+++ b/debian/ceilometer-agent-compute.upstart.in
@@ -14,4 +14,12 @@ pre-start script
chown ceilometer:ceilometer /var/lock/ceilometer
end script
-exec su -s /bin/sh -c "exec ceilometer-agent-compute --config-file /etc/ceilometer/ceilometer.conf --log-file /var/log/ceilometer/ceilometer-agent-compute.log" ceilometer
+script
+ [ -r /etc/default/openstack ] && . /etc/default/openstack
+ [ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+ [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+ [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file /var/log/ceilometer/$UPSTART_JOB.log"
+
+ exec su -s /bin/sh -c "exec ceilometer-agent-compute --config-file /etc/ceilometer/ceilometer.conf $DAEMON_ARGS" ceilometer
+end script
diff --git a/debian/ceilometer-api.init b/debian/ceilometer-api.init
index d5bafc8..73dc9f2 100644
--- a/debian/ceilometer-api.init
+++ b/debian/ceilometer-api.init
@@ -27,7 +27,7 @@ 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 --log-file=$LOGFILE"
+DAEMON_ARGS="--config-file=/etc/${SYS_NAME}/ceilometer.conf"
[ -x $DAEMON ] || exit 0
@@ -38,6 +38,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 \
diff --git a/debian/ceilometer-api.upstart.in b/debian/ceilometer-api.upstart.in
index 5e9ff3e..8e947f8 100644
--- a/debian/ceilometer-api.upstart.in
+++ b/debian/ceilometer-api.upstart.in
@@ -14,4 +14,12 @@ pre-start script
chown ceilometer:ceilometer /var/lock/ceilometer
end script
-exec su -s /bin/sh -c "exec ceilometer-api --log-file /var/log/ceilometer/ceilometer-api.log --config-file /etc/ceilometer/ceilometer.conf" ceilometer
+script
+ [ -r /etc/default/openstack ] && . /etc/default/openstack
+ [ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+ [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+ [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file /var/log/ceilometer/$UPSTART_JOB.log"
+
+ exec su -s /bin/sh -c "exec ceilometer-agent-compute --config-file /etc/ceilometer/ceilometer.conf $DAEMON_ARGS" ceilometer
+end script
diff --git a/debian/ceilometer-collector.init b/debian/ceilometer-collector.init
index d584ffc..d216b29 100644
--- a/debian/ceilometer-collector.init
+++ b/debian/ceilometer-collector.init
@@ -27,7 +27,7 @@ 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 --log-file=$LOGFILE"
+DAEMON_ARGS="--config-file=/etc/${SYS_NAME}/ceilometer.conf"
[ -x $DAEMON ] || exit 0
@@ -38,6 +38,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 \
diff --git a/debian/ceilometer-collector.upstart.in b/debian/ceilometer-collector.upstart.in
index 2a60710..6fc7ab6 100644
--- a/debian/ceilometer-collector.upstart.in
+++ b/debian/ceilometer-collector.upstart.in
@@ -14,4 +14,12 @@ pre-start script
chown ceilometer:ceilometer /var/lock/ceilometer
end script
-exec su -s /bin/sh -c "exec ceilometer-collector --config-file /etc/ceilometer/ceilometer.conf --log-file /var/log/ceilometer/ceilometer-collector.log" ceilometer
+script
+ [ -r /etc/default/openstack ] && . /etc/default/openstack
+ [ -r /etc/default/$UPSTART_JOB ] && . /etc/default/$UPSTART_JOB
+
+ [ "x$USE_SYSLOG" = "xyes" ] && DAEMON_ARGS="$DAEMON_ARGS --use-syslog"
+ [ "x$USE_LOGFILE" != "xno" ] && DAEMON_ARGS="$DAEMON_ARGS --log-file /var/log/ceilometer/$UPSTART_JOB.log"
+
+ exec su -s /bin/sh -c "exec ceilometer-agent-compute --config-file /etc/ceilometer/ceilometer.conf $DAEMON_ARGS" ceilometer
+end script
_______________________________________________
Openstack-devel mailing list
Openstack-devel at lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/openstack-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Allow-selecting-log-destination-for-Ceilometer-daemons-debian-havana.patch
Type: text/x-patch
Size: 8162 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/openstack-devel/attachments/20140408/b4b54aea/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Allow-selecting-log-destination-for-Ceilometer-daemons-debian-icehouse.patch
Type: text/x-patch
Size: 14333 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/openstack-devel/attachments/20140408/b4b54aea/attachment-0003.bin>
More information about the Openstack-devel
mailing list