rsyslog: /var/log{/,/log-storage/} get mounted in wrong order

Bug #1648065 reported by Adrien Cunin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack-Ansible
Fix Released
Undecided
Adrien Cunin

Bug Description

In rsyslog containers, /var/log/log-storage/ is bind mounted in addition to /var/log/ being already bind mounted (which is the case in all containers).

The issue is that /var/log/log-storage/ is mounted before /var/log/, so nothing gets written into the directory that is bind mounted to /var/log/log-storage/.

I was thinking of fixing that by re-ordering the addition of bind mounts into the LXC config file in openstack-ansible:playbooks/common-tasks/os-lxc-container-setup.yml (lxc_default_bind_mounts first, then list_of_bind_mounts). However, I'm afraid it would break stuff: if /var/log/ gets mounted first, the directory /var/log/log-storage/ (which is created by one of the previous tasks) disappears, and as such the /var/log/log-storage/ bind mount is going to fail. Ideas?

Revision history for this message
Adrien Cunin (adri2000) wrote :

The create=dir mount option might help. Looking into it.

Changed in openstack-ansible:
assignee: nobody → Adrien Cunin (adri2000)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (master)

Fix proposed to branch: master
Review: https://review.openstack.org/408090

Changed in openstack-ansible:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (master)

Reviewed: https://review.openstack.org/408090
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=f219d90d8b85ed2c2c7a3771ee1f8143f1065fa6
Submitter: Jenkins
Branch: master

commit f219d90d8b85ed2c2c7a3771ee1f8143f1065fa6
Author: Adrien Cunin <email address hidden>
Date: Wed Dec 7 14:23:54 2016 +0100

    Process and mount default bind mounts first

    lxc_default_bind_mounts are now mounted before list_of_bind_mounts.
    As a consequence, /var/log/ is now mounted before /var/log/log-storage/
    in rsyslog containers.
    Also, directory creation inside the container is now handled by LXC
    (using the create=dir option) just before the directory gets mounted,
    so mounting a subdirectory after a directory (such as
    /var/log/log-storage/ and /var/log/) will work.

    Change-Id: I29be91b4dca5abe1bb8307429a86c06dbd3ef7aa
    Closes-Bug: #1648065

Changed in openstack-ansible:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-ansible (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/409768

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-ansible (stable/newton)

Reviewed: https://review.openstack.org/409768
Committed: https://git.openstack.org/cgit/openstack/openstack-ansible/commit/?id=8a660f7c2aa1b7ca9a638c9358400df627610d1d
Submitter: Jenkins
Branch: stable/newton

commit 8a660f7c2aa1b7ca9a638c9358400df627610d1d
Author: Adrien Cunin <email address hidden>
Date: Wed Dec 7 14:23:54 2016 +0100

    Process and mount default bind mounts first

    lxc_default_bind_mounts are now mounted before list_of_bind_mounts.
    As a consequence, /var/log/ is now mounted before /var/log/log-storage/
    in rsyslog containers.
    Also, directory creation inside the container is now handled by LXC
    (using the create=dir option) just before the directory gets mounted,
    so mounting a subdirectory after a directory (such as
    /var/log/log-storage/ and /var/log/) will work.

    Change-Id: I29be91b4dca5abe1bb8307429a86c06dbd3ef7aa
    Closes-Bug: #1648065
    (cherry picked from commit f219d90d8b85ed2c2c7a3771ee1f8143f1065fa6)

tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 15.0.0.0b2

This issue was fixed in the openstack/openstack-ansible 15.0.0.0b2 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/openstack-ansible 14.0.4

This issue was fixed in the openstack/openstack-ansible 14.0.4 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.