On 2023-05-17 18:02 UTC, l...@fuji.kuistio.me wrote: > Hi > > I have a desktop machine I recently installed OpenBSD 7.3 on. Everything > seems to be working fine except that it doesn't obtain a DHCP lease when > waking up from suspend. I haven't found any docs saying if it even should > do this. However, I also have a laptop running 7.3 and it does automatically > connect to a network when waking up from suspend. So I'm a bit confused > about why this works on the laptop but not on the desktop. > > On both machines I have created a hostname.if file under /etc. The desktop > machine does obtain a dhcp lease after the system has booted up, but it > doesn't do this after waking up from suspend as explained earlier. The > laptop is using wifi and the desktop is using a usb-ethernet adapter.
The USB Ethernet adapter gets disconnected from the USB bus on suspend and re-discovered on resume. ifconfig will show that it does not have the autoconf flag set nor does it have any IPv4 addresses configured. Effectively it becomes a new device on resume. I'm not aware of any way to fix / work around this. Calling netstart(8) from apm probably races against the kernel and the USB adapter might not be there yet when it runs. > > Is this kind of behaviour expected? It's not a huge issue, since suspending > the desktop machine is not that necessary. I'm just quite puzzled because > these two machines behave differently even though the configuration should > be almost identical. I tried to resolve the issue by creating a script in > /etc/apm/resume that should run /etc/netstart, but for whatever reason this > script does not seem to run at all when the machine wakes up. > > I'm new to using OpenBSD as a desktop. I've used it a > little bit on a headless server before, but I recently decided to start using > it > as a desktop out of interest. Everything else seems to be working as > expected. > -- In my defence, I have been left unsupervised.