Skip to content
Contents
GuidesOpenWrt

OpenWrt dnsmasq cannot open /dev/null: check the log destination and device node

When the startup log says cannot open log /dev/null, first find what selected that path as a log file. On one mediatek/filogic snapshot the diagnosis led back to an inherited logging setting. Ownership or a single startup error does not establish a procd defect. Preserve wired management access and the configuration while diagnosing DNS.

When the startup log says cannot open log /dev/null, first find what selected that path as a log file. On one mediatek/filogic snapshot the diagnosis led back to an inherited logging setting. Ownership or a single startup error does not establish a procd defect. Preserve wired management access and the configuration while diagnosing DNS.

Read UCI, the generated configuration and the node type

uci show dhcp | grep -E 'logfacility|=dnsmasq'
grep -n '^log-facility=' /var/etc/dnsmasq.conf.* 2>/dev/null
ls -ln /dev/null
logread -e dnsmasq | tail -20

In our default 25.12.6 test instance the generated configuration had no explicit log-facility line. /dev/null was a character device with major and minor numbers 1 and 3 and mode 0666. Match each instance to its log and generated file. If the configuration says log-facility=/dev/null, trace it back to the UCI section and included files. Direct edits to generated files disappear when regenerated.

The reference guest has no explicit log file and still answers a local query

Revert only the logging setting identified by the evidence

Back up /etc/config/dhcp and the actual included files. If the logging destination was inherited unintentionally, remove it from the affected instance, save, restart dnsmasq and recheck the generated configuration and startup log. For an intentional log file verify the directory, permissions, jail mount and free space. Avoid changing a shared device node as a trial fix. If no explicit destination exists, retain the node details, firmware build and first error for further diagnosis.

First query a known local name through the router's own resolver. Then query a known external name from a LAN client explicitly using this router. Confirm both answers and continued service operation. Restore the saved configuration and restart the same service if behavior regresses.

When OpenWrt cannot install a package

Explore hardware

Comments