OpenWrt Forum Archive

Topic: [fixed] r49252 breaks dns/dhcp for a sysupgrade with saved settings

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I write the message also here, because r49252 breaks things in a nasty way for anybody who does trunk sysupgrade with settings preserved.

Bug report: https://dev.openwrt.org/ticket/22271

r49252 breaks things in a major way in a sysupgrade with settings preserved, as dnsmasq does not start and DNS and DHCP do not work.

If a router is flashed with a new firmware with revision >= 49252, it will expect to find user "dnsmasq" in /etc/password and /etc/shadow as well as group "dnsmasq" in /etc/group. If those are not found, dnsmasq does not start and all connectivity breaks down.

root@OpenWrt:~# logread | grep dnsm
Wed Apr 27 11:27:52 2016 daemon.crit dnsmasq[2753]: unknown user or group: dnsmasq
Wed Apr 27 11:27:52 2016 daemon.crit dnsmasq[2753]: FAILED to start up
...
Wed Apr 27 11:28:11 2016 daemon.info procd: Instance dnsmasq::instance1 s in a crash loop 6 crashes, 0 seconds since last crash

I fixed my own router by manually copying /rom/etc/passwd, /rom/etc/shadow and /rom/etc/group to /etc

EDIT: other possible fixes:
1) use "firstboot" command to reset the router, or select Reset in Luci.
2) manually edit those three files and add the lines shown in comment 1 of bug #22271

EDIT:
the problem has been fixed by r49276. Flashing a new 49276+ firmware will fix the problem.

(Last edited by hnyman on 1 May 2016, 13:39)

thanks for the heads up.  so if i have created a sysupgrade.tar file from a trunk r49263 tar ball, then i need to start fresh and don't save any router setting when flashing, right?  or i can simply include the settings i need in the /files during make image and flash without keeping setting.

You are fine if you sysupgrade without saving settings and start from scratch.
Alternatively you could manually add those lines before the upgrade, so that you manually create the user while still using the old version.

The problem only arises if you start the router with the new version but still have the old config without the user and group.

EDIT:
the problem only concern firmware versions r49252-49275.
r49276 fixes things again.

(Last edited by hnyman on 1 May 2016, 13:40)

The discussion might have continued from here.