From 5f79927c58d342cf29417cef4b6e9111854224af Mon Sep 17 00:00:00 2001 From: Juan Antonio Osorio Robles Date: Fri, 27 Oct 2017 10:22:01 +0300 Subject: persist memcached logs in /var/log/containers/memcached/memcached.log We used to bind-mount /var/log/memcached.log, but this resulted in the file being createdin the memcached container as a directory, since this file didn't exist. This commit takes the approach of other containers and gets the logs to a memcached directory in /var/log/containers. Change-Id: I926b65fa557ad56b4faa2be34452b58f7b01247a Closes-Bug: #1720183 (cherry picked from commit 5020f38301a9a0a70f34878196250e24fc639dec) --- docker/services/memcached.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/services/memcached.yaml b/docker/services/memcached.yaml index c78b85a6..817f9ec7 100644 --- a/docker/services/memcached.yaml +++ b/docker/services/memcached.yaml @@ -80,8 +80,8 @@ outputs: user: root volumes: - /var/lib/config-data/memcached/etc/sysconfig/memcached:/etc/sysconfig/memcached:ro - - /var/log/memcached.log:/var/log/memcached.log - command: ['/bin/bash', '-c', 'source /etc/sysconfig/memcached; chown ${USER} /var/log/memcached.log'] + - /var/log/containers/memcached:/var/log/ + command: ['/bin/bash', '-c', 'source /etc/sysconfig/memcached; touch /var/log/memcached.log && chown ${USER} /var/log/memcached.log'] memcached: start_order: 1 image: *memcached_image @@ -93,7 +93,7 @@ outputs: - {get_attr: [ContainersCommon, volumes]} - - /var/lib/config-data/memcached/etc/sysconfig/memcached:/etc/sysconfig/memcached:ro - # TODO(bogdando) capture memcached syslog logs from a container + - /var/log/containers/memcached:/var/log/ command: ['/bin/bash', '-c', 'source /etc/sysconfig/memcached; /usr/bin/memcached -p ${PORT} -u ${USER} -m ${CACHESIZE} -c ${MAXCONN} $OPTIONS'] upgrade_tasks: - name: Stop and disable memcached service -- cgit 1.2.3-korg