Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-nspawn uses hard-coded location for resolv.conf #7302

Closed
mbiebl opened this issue Nov 11, 2017 · 4 comments
Closed

systemd-nspawn uses hard-coded location for resolv.conf #7302

mbiebl opened this issue Nov 11, 2017 · 4 comments

Comments

@mbiebl
Copy link
Contributor

mbiebl commented Nov 11, 2017

At https://github.com/systemd/systemd/blob/master/src/nspawn/nspawn.c#L1413 we hard-code the location for the system installed resolv.conf and check for /usr/lib/systemd/resolv.conf

For split-usr systems, resolv.conf is not installed at /usr though, but /lib/systemd/resolv.conf:
https://github.com/systemd/systemd/blob/master/src/resolve/meson.build#L140 (rootlibexecdir)

@mbiebl
Copy link
Contributor Author

mbiebl commented Nov 11, 2017

Seems it's hard-coded in a few other places as well:

tmpfiles.d/etc.conf.m4:L! /etc/resolv.conf - - - - ../usr/lib/systemd/resolv.conf
src/nspawn/nspawn.c:        if (access("/usr/lib/systemd/resolv.conf", F_OK) >= 0 &&
src/nspawn/nspawn.c:                r = mount_verbose(LOG_DEBUG, "/usr/lib/systemd/resolv.conf", resolved, NULL, MS_BIND, NULL);

@poettering
Copy link
Member

hmm, where's resolved itself installed on such systems? if it's in /usr/lib, then i figure its resolv.conf should also be in /usr/lib, and we should change rootlibexecdir → libexecdir here...

@mbiebl
Copy link
Contributor Author

mbiebl commented Nov 13, 2017

@poettering resolved is installed to roolibexecdir:

https://github.com/systemd/systemd/blob/master/meson.build#L1420

        executable('systemd-resolved',
                   systemd_resolved_sources,
                   gcrypt_util_sources,
                   include_directories : includes,
                   link_with : [libshared],
                   dependencies : [threads,
                                   libgcrypt,
                                   libgpg_error,
                                   libm,
                                   libidn],
                   install_rpath : rootlibexecdir,

https://github.com/systemd/systemd/blob/master/src/resolve/meson.build#L139

        install_data('resolv.conf',
                     install_dir : rootlibexecdir)

@poettering
Copy link
Member

hmm, ok. an i figure that's because networkd can run in early boot too... maybe we should leave it that way then.

Anyway, a patch that fixes the resolv.conf path for split-usr systems would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants