Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Architectures & Platforms Gentoo on ARM
  • Search

dhcpcd not renewing lease after carrier lost

Gentoo on all things ARM. Both 32 bit and 64 bit.
Tell about your hardware and CHOST.
Problems with crossdev targeting ARM hardware go here too.
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
Author
Message
erg_samowzbudnik
Apprentice
Apprentice
User avatar
Posts: 257
Joined: Fri Sep 09, 2011 3:10 pm
Location: European sticks

dhcpcd not renewing lease after carrier lost

  • Quote

Post by erg_samowzbudnik » Thu Feb 05, 2026 3:12 pm

Hi.
TLDR: On a headless raspberry pi 3 when router goes down and comes back up, wifi connection is lost.

I have two network services:
/etc/init.d/net.wlan0
/etc/init.d/net.enu1u1

with corresponding files in /etc/conf.d:
net.wlan0:

Code: Select all

preup() {
        rfkill unblock all
        return 0
}

modules_wlan0="wpa_supplicant dhcpcd"
config_wlan0="dhcp"
net.enu1u1:

Code: Select all

config_enu1u1="192.168.100.177/24"
dns_servers_enu1u1="192.168.100.1 8.8.8.8"
On startup, everything works fine.
If I restart any of those services, things work fine.

Things get hairy when wireless router goes down and comes back.
Those are the relevant entries from /var/log/messages:

Code: Select all

Feb  5 13:09:53 rpi dhcpcd[1891]: wlan0: carrier lost
Feb  5 13:09:53 rpi wpa_cli[3882]: interface wlan0 DISCONNECTED
Feb  5 13:09:53 rpi dhcpcd[1891]: wlan0: deleting route to 192.168.0.0/24
Feb  5 13:09:53 rpi dhcpcd[1891]: wlan0: deleting default route via 192.168.0.1
Feb  5 13:09:55 rpi dhcpcd[4080]: sending signal TERM to pid 1891
Feb  5 13:09:55 rpi dhcpcd[4080]: waiting for pid 1891 to exit
Feb  5 13:09:55 rpi dhcpcd[1891]: received SIGTERM, stopping
Feb  5 13:09:55 rpi dhcpcd[1891]: wlan0: removing interface
Feb  5 13:10:45 rpi dhcpcd[4080]: pid 1891 failed to exit   # <-- this is dhcpcd failing to exit
Feb  5 13:11:29 rpi wpa_cli[4263]: interface wlan0 CONNECTED
Feb  5 13:11:30 rpi rfkill[4354]: unblock set for all
Feb  5 13:11:31 rpi dhcpcd[4449]: sending commands to dhcpcd process
Feb  5 13:11:31 rpi dhcpcd[1891]: control command: dhcpcd -m 2003 wlan0
So dhcpcd fails to exit and no IP is set on wlan0.

I noticed that restarting net.wlan0 service fails to terminate dhcpcd process just the same.
If I kill dhcpcd and restart the service, things work.
If I stop net.wlan0 service and run wpa_supplicant and dhcpcd manually, network gets back up when router goes down and comes back up.

My /etc/dhcpcd.conf contains default settings.

So clearly the issue is with dhcpcd failing to exit when it is run as a part of a net.wlan0 service.

I'm failing to understand why and what to do about it.
Top
gentoo_ram
Guru
Guru
Posts: 528
Joined: Thu Oct 25, 2007 10:04 pm
Location: San Diego, California USA

  • Quote

Post by gentoo_ram » Fri Feb 06, 2026 12:03 am

I would recommend trying to use iwd instead of wpa_supplicant to handle Wifi connections. I've found it to be much more reliable than wpa_supplicant. As a bonus, the daemon is a lot more compact. Follow the wiki directions to configure using iwd. I use it on both of my RPis (4 and 5).

From /etc/conf.d/net:

Code: Select all

modules_phy0="iwd debug"
modules_wlan0="iwd debug"
iwd_wlan0="phy0 debug"
config_wlan0="dhcp"
dhcp_wlan0="nontp"

preup() {

rfkill unblock all

return 0

}
Be sure to install net-wireless/iwd.

Just a couple daemons are created:

Code: Select all

 2744  2744 root      0.0  0.0 Ss   ?        00:00:26  3808  16244 /usr/libexec/iwd -p phy0 -i wlan0
 2791  2790 root      0.0  0.0 S    ?        00:00:11  2060   2784 dhcpcd: wlan0 [ip4] [ip6]
Top
Zucca
Administrator
Administrator
User avatar
Posts: 4691
Joined: Thu Jun 14, 2007 10:31 pm
Location: Rasi, Finland
Contact:
Contact Zucca
Website

  • Quote

Post by Zucca » Fri Feb 06, 2026 8:04 am

FWIW, I just switched from networkmanager (because it became unprdictable) to dhcpcd + wpa_supplicant (I also ditched connman on my laptop for these two).
But I don't use the net.* scripts. I configured both manually. Both tools have optional GUIs, but I haven't tested them yet.
..: Zucca :..

Code: Select all

init=/sbin/openrc-init
-systemd -logind -elogind seatd
I am NaN! I am a man!
Top
erg_samowzbudnik
Apprentice
Apprentice
User avatar
Posts: 257
Joined: Fri Sep 09, 2011 3:10 pm
Location: European sticks

  • Quote

Post by erg_samowzbudnik » Fri Feb 06, 2026 11:13 am

Worked around it by adding to /etc/conf.d/net.wlan0:

Code: Select all

predown() {
killall -6 dhcpcd
return 0
}
Not ideal but it does the job.
Will not mark it fixed as it's a hack, service should be able to terminate dhcpcd without this hack so it's still a mystery to me.
Top
Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “Gentoo on ARM”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic