My systemd shutdown phase shows in the logs journalctl -b -1 continuus attempts of dhcpcd.service to reconnect. I wonder if such change would be fine: --- dhcpcd.service 2013-08-03 14:07:49.000000000 +0200 +++ dhcpcd.service 2013-08-06 15:02:19.608615974 +0200 @@ -1,7 +1,8 @@ [Unit] Description=Lightweight DHCP client daemon Wants=network.target -Before=network.target +Conflicts=shutdown.target +Before=network.target shutdown.target [Service] ExecStart=/sbin/dhcpcd -q --nobackground
Also I receive some kernel segfault when stop. Wouldn't it be better to: TimeoutSec=4 KillMode=process ExecStop=/sbin/dhcpcd --exit which should invoke a full kill --signal sequence after 4secs after using the dhcpcd internal exiting feature.
I don't know why I get this segfault despite stoping dhcpcd gracefully as above described: Aug 06 21:59:35 maci systemd[1]: Stopping Lightweight DHCP client daemon... Aug 06 21:59:35 maci dhcpcd[2742]: dhcpcd[2742]: sending signal 15 to pid 332 Aug 06 21:59:35 maci dhcpcd[2742]: dhcpcd[2742]: waiting for pid 332 to exit Aug 06 21:59:35 maci dhcpcd[2742]: sending signal 15 to pid 332 Aug 06 21:59:35 maci dhcpcd[2742]: waiting for pid 332 to exit Aug 06 21:59:35 maci dhcpcd[332]: received SIGTERM from PID 2742, stopping Aug 06 21:59:35 maci dhcpcd[332]: eth0: removing interface Aug 06 21:59:35 maci dhcpcd[332]: wlan0: removing interface Aug 06 21:59:35 maci dhcpcd[332]: wlan0: deleting host route to 192.168.1.122 via 127.0.0.1 Aug 06 21:59:35 maci dhcpcd[332]: wlan0: deleting route to 192.168.1.0/24 Aug 06 21:59:35 maci dhcpcd[332]: wlan0: deleting default route via 192.168.1.1 Aug 06 21:59:35 maci systemd[1]: dhcpcd.service: main process exited, code=killed, status=11/SEGV Aug 06 21:59:35 maci kernel: dhcpcd[332]: segfault at 18 ip 00007f32e5245ae5 sp 00007fff7b3c4580 error 4 in libc-2.17.so[7f32e51c7000+1a7000] Aug 06 21:59:39 maci systemd[1]: dhcpcd.service stopping timed out. Terminating. Aug 06 21:59:39 maci systemd[1]: Stopped Lightweight DHCP client daemon. Aug 06 21:59:39 maci systemd[1]: Unit dhcpcd.service entered failed state I can reconnect with "systemctl start dhcpcd" without problem though ...
Roy, I know you can't tell me the specifics about the systemd unit, but, you can tell me whether it matters how dhcpcd is killed. Should we use dhcpcd --exit to bring dhcpcd down? (this will affect the OpenRC init script as well). Also, I am concerned about the seg fault message, it looks like it might be dhcpcd seg faulting. Thanks, William
dhcpcd --exit is fine The segfault is a bug though. Is a /dhcpcd.core generated? If so, can you post a decent backtrace of the crash?
@Roy, hmm no dhcpcd.core. Does it depend on some kernel .config (I disabled core dumps)? I can confirm downgrading to stable dhcpcd-5.6.4 doesn't produce any segfault with following /etc/dhcpcd.conf: --- hostname # option rapid_commit # I had rapid_commit with dhcpcd-6 option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes option ntp_servers require dhcp_server_identifier nohook lookup-hostname option interface_mtu noipv4ll ipv4only interface wlan0 ssid secondary static ip_address=192.168.2.88 static routers=192.168.2.1 static domain_name_servers=192.168.2.1 release ssid primary static ip_address=192.168.1.122 static routers=192.168.1.1 static domain_name_servers=192.168.1.1 release --- This way I have a primary 192.168.1.122 and a fallback fallback wlan 192.168.2.1 if I set according /etc/wpa_supplicant/wpa_supplicant.conf. Is there something wrong with this setup?
I think you need to enable kernel core dumps to get a crash dump. Also, depending on your config you may need to do `ulimit -c` before calling dhcpcd (unsure how todo this from systemd). I'll look into testing your config when time permits to see if that's the cause.
segfault fixed here: http://roy.marples.name/projects/dhcpcd/changeset/d995aa130fcdadc3a99f948c89447d9960b8753e
@Roy, thanks for the fix! Works with USE flag -ipv6, but as the fix is patching only ipv4.c the segfault should be fixed for all.
The patch for the segfault is encorporated into dhcpcd-6.0.5-r1.
Since the segfault is fixed in 6.0.5-r1 and 6.1, I am closing this bug. If you have other issues, please open bugs for them, one per issue. Thanks much, William