From: Franck Bui Date: Wed, 7 Dec 2016 20:36:39 +0000 (+0100) Subject: nspawn: resolv.conf might not be created initially (#4799) X-Git-Tag: v234~747 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5367354dae90f0901ec3b96cbbc9f96bf4a71d11;p=platform%2Fupstream%2Fsystemd.git 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. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index ddd6a64..cb09392 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,