Description of problem: The oci-systemd-hook tries to propagate the journal from systemd-based container to the host by creating and mounting host's directory to the container. However, when /var/log is not available in the container image, oci-systemd-hook mounts under /run/journal instead of under /run/log/journal. And systemd-journald(8) says: The journal service stores log data either persistently below /var/log/journal or in a volatile way below /run/log/journal/ (in the latter case it is lost at reboot). So the directory on the host is created and mounted but not used by systemd in the container. Version-Release number of selected component (if applicable): oci-systemd-hook-0.1.17-3.gitbd86a79.fc28.x86_64 How reproducible: Deterministic. Steps to Reproduce: 1. Have Dockerfile FROM registry.fedoraproject.org/fedora:28 RUN mkdir -p /data-template/var && mv /var/log /data-template/var/log && ln -s /data/var/log /var/log VOLUME [ "/data" ] ENTRYPOINT [ "/usr/sbin/init" ] 2. Build image: docker build -t journald . 3. Run container: docker run --name systemd --rm -i journald 4. In different terminal, check the mounted directory: $ docker exec systemd mount | grep journal /dev/mapper/vg_host-lv_fedora on /run/journal/92bfd207a8dc5f5e097172aa5adff47c type ext4 (rw,relatime,seclabel) 5. Check where the journal is actually stored in the container: $ docker exec systemd ls -dla /run/journal/92bfd207a8dc5f5e097172aa5adff47c/system.journal /run/log/journal/92bfd207a8dc5f5e097172aa5adff47c/system.journal 6. Check if the journal is stored on host: $ ls -la /var/log/journal/92bfd207a8dc5f5e097172aa5adff47c/ Actual results: The ls in the container: -rw-r-----+ 1 root systemd-journal 839680 Sep 12 15:31 /run/log/journal/92bfd207a8dc5f5e097172aa5adff47c/system.journal ls: cannot access '/run/journal/92bfd207a8dc5f5e097172aa5adff47c/system.journal': No such file or directory The ls on the host: total 80 drwxr-sr-x+ 2 root root 4096 Sep 12 17:31 . drwxr-sr-x+ 1119 root systemd-journal 65536 Sep 12 17:31 .. Expected results: The ls in the container: -rw-r-----+ 1 root systemd-journal 839680 Sep 12 15:31 /run/log/journal/92bfd207a8dc5f5e097172aa5adff47c/system.journal ls: cannot access '/run/journal/92bfd207a8dc5f5e097172aa5adff47c/system.journal': No such file or directory The ls on the host: total 80 drwxr-sr-x+ 2 root root 4096 Sep 12 17:31 . drwxr-sr-x+ 1119 root systemd-journal 65536 Sep 12 17:31 .. -rw-r-----+ 1 root systemd-journal 839680 Sep 12 15:31 system.journal Additional info:
I don't see a /run/log/journal on my F28 box?
You mean, when you run the above-built image on your Fedora 28 host with docker-1.13.1-61.git9cb56fd.fc28.x86_64, you see systemd running in the container but the /run/log/journal is not there?
No I am questioning the existence of /run/log/journal on my host? If I don't see it on the host, why would I expect it in the container?
You likely don't have /run/log/journal on your host because you have persistent /var/log/journal. The oci-systemd-hook tries to mount host's /var/log/journal subdirectory to container's /var/log/journal, and falls back to /run ... but falls back to /run/journal, instead of /run/log/journal.
PTAL https://github.com/projectatomic/oci-systemd-hook/pull/105
oci-systemd-hook-0.1.18-1.git38504cc.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2018-70fe37d613
oci-systemd-hook-0.1.18-1.git38504cc.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-8ea6d38282
oci-systemd-hook-0.1.18-1.git38504cc.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-8ea6d38282
oci-systemd-hook-0.1.18-1.git38504cc.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-70fe37d613
oci-systemd-hook-0.1.18-1.git38504cc.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.
oci-systemd-hook-0.2.0-1.git05e6923.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-baa35c7a81
oci-systemd-hook-0.2.0-1.git05e6923.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-baa35c7a81
oci-systemd-hook-0.2.0-1.git05e6923.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.