When doing ifup wlan0 on a system with / mounted as read-only (embedded computer), I get this error:
Failed to connect to non-global ctrl_ifname: wlan0 error: Read-only file system
Internet Systems Consortium DHCP Client 4.3.1
Copyright 2004-2014 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
can't create /var/lib/dhcp/dhclient.wlan0.leases: Read-only file system
Listening on LPF/wlan0/80:1f:02:d3:42:b8
Sending on LPF/wlan0/80:1f:02:d3:42:b8
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
...
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
On the other hand, when doing ifup wlan0 with / mounted as read-write, no problem, an IP is succesfully attributed.
How to make DHCP work on a read-only root filesystem?
# /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid "<myssid>"
wpa-psk "<mypasswd>"
/varand/tmpmust be writable. If you search for "read only root filesystem", there are several guides explaining this. You can either use a separate disk partition for/var, make/vara tmpfs partition, or use a unionfs overlay so the file system appears writable but changes are forgotten on reboot. – Mikel Jun 16 '15 at 13:45