mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
nspawn: allow to bind mount journal on top of a non empty container journal dentry
Currently if nspawn was called with --link-journal=host or --link-journal=auto and the right /var/log/journal/machine-id/ exists then the bind mount the subdirectory into the container might fail due to the ~/mycontainer/var/log/journal/machine-id/ of the container not being empty. There is no reason to check if the container journal subdir is empty since there will be a bind mount on top of it. The user asked for a bind mount so give it. Note: a next call with --link-journal=guest may fail due to the /var/log/journal/machine-id/ on the host not being empty. https://bugs.freedesktop.org/show_bug.cgi?id=76193 Reported-by: Tobias Hunger <tobias.hunger@gmail.com>
This commit is contained in:
parent
2f14583f47
commit
e6a4a517be
@ -1143,11 +1143,6 @@ static int setup_journal(const char *directory) {
|
|||||||
} else if (access(p, F_OK) < 0)
|
} else if (access(p, F_OK) < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (dir_is_empty(q) == 0) {
|
|
||||||
log_error("%s not empty.", q);
|
|
||||||
return -ENOTEMPTY;
|
|
||||||
}
|
|
||||||
|
|
||||||
r = mkdir_p(q, 0755);
|
r = mkdir_p(q, 0755);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
log_error("Failed to create %s: %m", q);
|
log_error("Failed to create %s: %m", q);
|
||||||
|
Loading…
Reference in New Issue
Block a user