1 |
Hello, |
2 |
|
3 |
Many modern systems have their /etc/resolv.conf files autogenerated at |
4 |
runtime with DHCP, PPP or so on. Thus, storing that file in /etc seems |
5 |
no longer correct as that directory may be mounted read-only. |
6 |
|
7 |
I'm attaching a net-dns/resolvconf-symlink ebuild which |
8 |
replaces /etc/resolv.conf with a symlink to a runtime-writable location |
9 |
when installed. That package could be added to PDEPEND of packages like |
10 |
net-misc/networkmanager or net-dns/openresolv. |
11 |
|
12 |
Right now, that location is /var/run/resolv.conf. Using /run seems |
13 |
better for it but that directory is not yet in our baselayout. |
14 |
|
15 |
The package has USE=symlink which could be disabled by users which want |
16 |
to keep /etc/resolv.conf as-is. |
17 |
|
18 |
Right now, pkg_preinst() ensures that /etc/resolv.conf is autogenerated |
19 |
(tested with resolvconf and networkmanager) or doesn't exist and refuses |
20 |
to install otherwise. In future, this will be expanded to support more |
21 |
cases if necessary. |
22 |
|
23 |
In addition to that, pkg_preinst() and pkg_postrm() handle moving |
24 |
resolv.conf there and back to avoid leaving user with no nameservers. |
25 |
|
26 |
I also covered a similar idea in bug #377595 [1]. |
27 |
|
28 |
[1]:https://bugs.gentoo.org/show_bug.cgi?id=377595 |
29 |
|
30 |
-- |
31 |
Best regards, |
32 |
Michał Górny |