burmilla / os

Tiny Linux distro that runs the entire OS as Docker containers
https://burmillaos.org
Apache License 2.0
210 stars 13 forks source link

v1.9.4 does not update /etc/resolv.conf when using DHCP #132

Closed netsandbox closed 2 years ago

netsandbox commented 2 years ago

I upgraded a v1.9.3 to v1.9.4 and after the upgrade name resolution isn't working, because /etc/resolv.conf wasn't updated with the nameserver received from dhcp.

Before upgrade:

rancher@burmilla:~$ cat /etc/resolv.conf 
# Generated by dhcpcd from eth0.dhcp
# /etc/resolv.conf.head can replace this line
domain example.com
nameserver 10.x.x.x
nameserver 10.x.x.x
# /etc/resolv.conf.tail can replace this line

rancher@burmilla:~$ cat /run/dhcpcd/resolv.conf/eth0.dhcp 
# Generated by dhcpcd from eth0.dhcp
domain example.com
search example.com
nameserver 10.x.x.x
nameserver 10.x.x.x

After upgrade:

rancher@burmilla:~$ cat /etc/resolv.conf 
nameserver 8.8.8.8
nameserver 8.8.4.4

rancher@burmilla:~$ cat /run/dhcpcd/resolv.conf/eth0.dhcp 
# Generated by dhcpcd from eth0.dhcp
domain example.com
search example.com
nameserver 10.x.x.x
nameserver 10.x.x.x

Even when I want to install a fresh VM from the ISO, the same problem happens here and I can't install the OS with a cloud-init from a URL:

rancher@burmilla:~$ cat /etc/resolv.conf 
nameserver 8.8.8.8
nameserver 8.8.4.4

rancher@burmilla:~$ cat /run/dhcpcd/resolv.conf/eth0.dhcp 
# Generated by dhcpcd from eth0.dhcp
domain example.com
search example.com
nameserver 10.x.x.x
nameserver 10.x.x.x
olljanat commented 2 years ago

Argh, that is nasty bug which I totally forgot to check during testing.

olljanat commented 2 years ago

OK. So what we get now is this one https://github.com/burmilla/os/blob/d45ff6fdc009f1f8e99a38f05fe2697fd7e23004/cmd/network/network.go#L82-L90 and that is because for some reason DHCP set DNS values are not found from here: https://github.com/burmilla/os/blob/d45ff6fdc009f1f8e99a38f05fe2697fd7e23004/pkg/netconf/netconf_linux.go#L172-L220

PS. I did took 1.9.4 version away from upgrade list now and updated also v1.9.4 release notes because of this.

EDIT: It looks to be that dhcpd binary fails on that command so maybe it have some new requirements for libraries or there is new bug on it:

$ sudo system-docker exec -it network sh
sh-5.1# dhcpcd -MA4 -U eth0
Bad system call
olljanat commented 2 years ago

Should be fixed on https://github.com/burmilla/os/releases/tag/v1.9.5-rc1 by #133

netsandbox commented 2 years ago

Just tested a upgrade and a fresh install with v1.9.5-rc1 and the bug is fixed for me. Thank you for your really quick support here.

olljanat commented 2 years ago

Very good. However I keep this one open as notice for everyone until we have released non-RC version with this fix.

pwFoo commented 2 years ago

Hi @olljanat, is a bug fix release planned or should I move to pre-release?

olljanat commented 2 years ago

@pwFoo I think that best option is switch to v1.9.5-rc1 for now. I have a bit too many things in table now and summer is coming so unless someone reports about serious new bug(s) then most probably next version will be released on autumn.