From 1ad23b193fba723c60517f07ae6aa6dff4fb536f Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Thu, 3 Jul 2014 17:35:50 +0100 Subject: [PATCH] Log tripleo services to syslog Logging to an upstart logfile results in log entries that are not associated with a timestamp(e.g. os-collect-config). This isn't consistent with the log files produced in other openstack CI tests and means we can't index them in logstash (at least consistently with how the other projects are indexed). As a result of this we will need to remove the double time stamps that get produced (by taking them out in each of the services configuration) and extract the log at the end of CI into per-service files so that we can selectively index the files we want. In particular the service that doesn't contain timestamps in all of the log entries is os-collect-config which is arguably one of the most important service logs we want indexed. We could simply just divert this service alone to syslog but doing them all is more consistent with other distros and how this will presumably work when ubuntu moves to systemd. Change-Id: Ib8c1fc39d56b2b9c6d8e9b64a868def619aa2f1f --- .../os-collect-config-source-install/10-os-collect-config | 6 +++++- elements/os-svc-install/bin/os-svc-daemon | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/elements/os-collect-config/install.d/os-collect-config-source-install/10-os-collect-config b/elements/os-collect-config/install.d/os-collect-config-source-install/10-os-collect-config index 8667a8c88..500ba6576 100755 --- a/elements/os-collect-config/install.d/os-collect-config-source-install/10-os-collect-config +++ b/elements/os-collect-config/install.d/os-collect-config-source-install/10-os-collect-config @@ -38,7 +38,11 @@ if [ "$DIB_INIT_SYSTEM" == "upstart" ] ; then start on runlevel [2345] stop on runlevel [016] respawn -exec os-collect-config + +# We're logging to syslog +console none + +exec os-collect-config 2>&1 | logger -t os-collect-config eof elif [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then diff --git a/elements/os-svc-install/bin/os-svc-daemon b/elements/os-svc-install/bin/os-svc-daemon index f2c1e610d..eca2c8d4b 100755 --- a/elements/os-svc-install/bin/os-svc-daemon +++ b/elements/os-svc-install/bin/os-svc-daemon @@ -128,7 +128,10 @@ respawn # not hit the default of 10 times in 5 seconds. Make it 2 times in 5s. respawn limit 2 5 -exec start-stop-daemon --start -c $user --exec $install_dir/bin/$cmd -- $args +# We're logging to syslog +console none + +exec start-stop-daemon --start -c $user --exec $install_dir/bin/$cmd -- $args 2>&1 | logger -t $name post-start $POSTSTART EOF