diff options
author | Franck Bui <fbui@suse.com> | 2016-12-07 21:36:39 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-12-07 21:36:39 +0100 |
commit | 5367354dae90f0901ec3b96cbbc9f96bf4a71d11 (patch) | |
tree | abf2901eac4bb0a46b84360a85f6660cedcbb3c0 | |
parent | e332833f070481223b949f9cc21d7e619e17e234 (diff) |
nspawn: resolv.conf might not be created initially (#4799)
This might happen that resolv.conf is missing in a minimal rootfs and in this
case the following warning is emitted:
Failed to mount n/a on /mnt/etc/resolv.conf (MS_BIND ""): No such file or directory
This patch fixes this case.
-rw-r--r-- | src/nspawn/nspawn.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index ddd6a64ec6..cb09392729 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -1299,6 +1299,8 @@ static int setup_resolv_conf(const char *dest) { * advantage that the container will be able to follow the host's DNS server configuration changes * transparently. */ + (void) touch(where); + r = mount_verbose(LOG_WARNING, "/usr/lib/systemd/resolv.conf", where, NULL, MS_BIND, NULL); if (r >= 0) return mount_verbose(LOG_ERR, NULL, where, NULL, |