ng-ifupdown/dhcp error messages when IF_DHCP_HOSTNAME is `(none)`
Shortly after upgrading from 3.18 to 3.19 I noticed this error on startup:
/usr/libexec/ifupdown-ng/dhcp: eval: line 3: syntax error: unexpected words (expecting ")")
This error message is repeated 7x.
That line is:
[ -n "$IF_DHCP_HOSTNAME" ] && IF_DHCP_HOSTNAME=$(eval echo $IF_DHCP_HOSTNAME)
With a little bit of fiddling with the script I figured out that IF_DHCP_HOSTNAME
is coming in set to "(none)
", hence the error.
My DHCP is a fairly stock setup of a Ubiquiti product; if this is a problem with whatever value DHCP is actually returning [update: it's not], it's probably a fairly common situation.
As a workaround, I created /etc/network/ifupdown-ng.conf
and put:
use_hostname_for_dhcp false
on every system to make the error message go away for the time being. But presumably the script should gracefully handle whatever it is normally possible for it to see on a real network. (Just eval
ing some value that comes in from... somewhere? doesn't seem great?)