Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]systemd/udev dhcpcd bailing out on boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Sulman
n00b
n00b


Joined: 15 Feb 2014
Posts: 63

PostPosted: Wed Aug 27, 2014 11:47 pm    Post subject: [solved]systemd/udev dhcpcd bailing out on boot Reply with quote

A little puzzler. This happens on both my home and work PC, very occasionally. Similar builds of Gentoo running systemd:

Code:
Aug 27 19:34:28 gentoopc dhcpcd[2966]: dev: loaded udev
Aug 27 19:34:28 gentoopc dhcpcd[2966]: no valid interfaces found
Aug 27 19:34:28 gentoopc dhcpcd[2966]: no interfaces have a carrier
Aug 27 19:34:28 gentoopc dhcpcd[2966]: lo: unsupported interface type 00, falling back to ethernet
Aug 27 19:34:28 gentoopc dhcpcd[2966]: lo: adding address fe80::c51:6906:1cbc:a26f
Aug 27 19:34:28 gentoopc dhcpcd[2966]: if_addaddress6: No such device
Aug 27 19:34:28 gentoopc dhcpcd[2966]: DUID 00:01:00:01:1a:ad:2e:11:00:24:1d:6b:cb:c9
Aug 27 19:34:28 gentoopc dhcpcd[2966]: lo: IAID 00:00:01:00
Aug 27 19:34:28 gentoopc dhcpcd[2966]: sit0: unsupported interface type 308, falling back to ethernet
Aug 27 19:34:28 gentoopc dhcpcd[2966]: sit0: adding address fe80::faa7:fd20:a2f8:24fb
Aug 27 19:34:28 gentoopc dhcpcd[2966]: sit0: waiting for carrier
Aug 27 19:34:28 gentoopc dhcpcd[2966]: enp3s0: adding address fe80::3bf2:8d7b:4805:913f
Aug 27 19:34:28 gentoopc dhcpcd[2966]: enp3s0: waiting for carrier
Aug 27 19:34:28 gentoopc dhcpcd[2966]: enp3s0: waiting for carrier
Aug 27 19:34:28 gentoopc dhcpcd[2966]: enp3s0: removing interface
Aug 27 19:34:28 gentoopc dhcpcd[2966]: sit0: carrier acquired
Aug 27 19:34:29 gentoopc dhcpcd[2966]: sit0: IAID 00:00:00:00
Aug 27 19:34:29 gentoopc dhcpcd[2966]: sit0: soliciting a DHCP lease
Aug 27 19:34:29 gentoopc dhcpcd[2966]: lo: needs a clientid to configure
Aug 27 19:34:29 gentoopc dhcpcd[2966]: lo: soliciting an IPv6 router
Aug 27 19:38:20 gentoopc dhcpcd[2966]: received signal TERM from PID 1, stopping
Aug 27 19:38:20 gentoopc dhcpcd[2966]: sit0: removing interface
Aug 27 19:38:20 gentoopc dhcpcd[2966]: lo: removing interface
Aug 27 19:38:20 gentoopc systemd[1]: dhcpcd.service: main process exited, code=exited, status=1/FAILURE
Aug 27 19:38:20 gentoopc systemd[1]: Unit dhcpcd.service entered failed state.
Aug 27 19:38:20 gentoopc dhcpcd[3715]: version 6.4.3 starting
Aug 27 19:38:20 gentoopc dhcpcd[3715]: dev: loaded udev
Aug 27 19:38:20 gentoopc dhcpcd[3715]: DUID 00:01:00:01:1a:ad:2e:11:00:24:1d:6b:cb:c9
Aug 27 19:38:20 gentoopc dhcpcd[3715]: enp3s0: IAID 1d:6b:cb:c9
Aug 27 19:38:20 gentoopc dhcpcd[3715]: enp3s0: rebinding lease of 10.0.0.200
Aug 27 19:38:21 gentoopc dhcpcd[3715]: enp3s0: soliciting an IPv6 router
Aug 27 19:38:21 gentoopc dhcpcd[3715]: enp3s0: Router Advertisement from fe80::ba9b:c9ff:fecb:e0c2
Aug 27 19:38:21 gentoopc dhcpcd[3715]: enp3s0: adding address 2601:7:8080:870:5b51:9eb3:e232:5d3f/64
Aug 27 19:38:21 gentoopc dhcpcd[3715]: enp3s0: adding route to 2601:7:8080:870::1/64
Aug 27 19:38:21 gentoopc dhcpcd[3715]: enp3s0: adding default route via fe80::ba9b:c9ff:fecb:e0c2
Aug 27 19:38:21 gentoopc dhcpcd[3715]: enp3s0: soliciting a DHCPv6 lease
Aug 27 19:38:25 gentoopc dhcpcd[3715]: enp3s0: leased 10.0.0.200 for 604800 seconds
Aug 27 19:38:25 gentoopc dhcpcd[3715]: enp3s0: adding route to 10.0.0.0/24
Aug 27 19:38:25 gentoopc dhcpcd[3715]: enp3s0: adding default route via 10.0.0.1
Aug 27 19:38:41 gentoopc dhcpcd[3715]: enp3s0: ADV 2601:7:8080:870:aa4d:7f9a:e920:a49b/128 from fe80::ba9b:c9ff:fecb:e0c2
Aug 27 19:38:51 gentoopc dhcpcd[3715]: enp3s0: REPLY6 received from fe80::ba9b:c9ff:fecb:e0c2
Aug 27 19:38:51 gentoopc dhcpcd[3715]: enp3s0: adding address 2601:7:8080:870:aa4d:7f9a:e920:a49b/128
Aug 27 19:38:51 gentoopc dhcpcd[3715]: enp3s0: renew in 144991 seconds, rebind in 231985 seconds


Essentially dhcpcd.service bails out having failed to work, because the interface isn't up yet; my gut feeling is udev isn't giving it enough time.

It's intermittent, and solved easily by restarting dhcpcd.service. I'm just wondering why this is happening, and it anyone else encounters it?


Last edited by Sulman on Wed Sep 10, 2014 2:49 am; edited 1 time in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Sun Aug 31, 2014 10:46 am    Post subject: Reply with quote

Code:
dhcpcd[2966]: received signal TERM from PID 1, stopping


That's why - systemd told dhcpcd to exit. I have no idea why.

What's a little worrying is that dhcpcd tries to operate on lo and sit0 says it has a carrier (from memory it shouldn't unless instructed AND up).
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Sulman
n00b
n00b


Joined: 15 Feb 2014
Posts: 63

PostPosted: Sun Aug 31, 2014 11:37 am    Post subject: Reply with quote

I thought that was strange too. Systemd was updated by an emerge @world recently so maybe that will fix it.
Back to top
View user's profile Send private message
zeronullity
Tux's lil' helper
Tux's lil' helper


Joined: 16 Oct 2010
Posts: 103

PostPosted: Mon Sep 01, 2014 1:37 am    Post subject: Reply with quote

[REMOVED UNRELATED ISSUE]

Last edited by zeronullity on Fri Sep 05, 2014 10:40 am; edited 3 times in total
Back to top
View user's profile Send private message
deefster
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2004
Posts: 77

PostPosted: Mon Sep 01, 2014 2:56 am    Post subject: Reply with quote

Have you tried NetworkManager? I myself used dhcpcd for years under the old rc style boot, but NetworkManager seems to work a bit better with systemd and parallel booting.
Back to top
View user's profile Send private message
zeronullity
Tux's lil' helper
Tux's lil' helper


Joined: 16 Oct 2010
Posts: 103

PostPosted: Mon Sep 01, 2014 9:23 am    Post subject: Reply with quote

deefster wrote:
Have you tried NetworkManager? I myself used dhcpcd for years under the old rc style boot, but NetworkManager seems to work a bit better with systemd and parallel booting.


I can usually work around most problems.. it's just unusual to get so many problems at once when no changes to use flags or config files were made. It's mostly likely a combination of package updates and useflags that didn't cause a problem before, however due to package changes are now causing major issues. I'll just have to solve them one by one until I can get a clear picture of just what happened. idk, just a waste of time regardless.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Mon Sep 01, 2014 9:27 am    Post subject: Reply with quote

deefster wrote:
Have you tried NetworkManager? I myself used dhcpcd for years under the old rc style boot, but NetworkManager seems to work a bit better with systemd and parallel booting.


dhcpcd works fine on a Debian/systemd system starting very early without any of these reported problems.
I'll try sytemd on my Gentoo installation at some point just to check.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
deefster
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2004
Posts: 77

PostPosted: Mon Sep 01, 2014 5:32 pm    Post subject: Reply with quote

I guess YMMV, I myself had issues with for example apache trying to fire up before the network was there.

UberLord wrote:
deefster wrote:
Have you tried NetworkManager? I myself used dhcpcd for years under the old rc style boot, but NetworkManager seems to work a bit better with systemd and parallel booting.


dhcpcd works fine on a Debian/systemd system starting very early without any of these reported problems.
I'll try sytemd on my Gentoo installation at some point just to check.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Mon Sep 01, 2014 6:53 pm    Post subject: Reply with quote

deefster wrote:
I guess YMMV, I myself had issues with for example apache trying to fire up before the network was there.


NetworkManager-wait-online.service
or
systemd-networkd-wait-online.service

Someone needs to write a dhcpcd variant of those systemd I guess.

EDIT: Or a better thing would be to patch apache to support the IP_FREEBIND socket option when you need to bind to a dynamic address.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
zeronullity
Tux's lil' helper
Tux's lil' helper


Joined: 16 Oct 2010
Posts: 103

PostPosted: Mon Sep 01, 2014 11:12 pm    Post subject: Reply with quote

[REMOVED UNRELATED ISSUE]

Last edited by zeronullity on Fri Sep 05, 2014 10:40 am; edited 10 times in total
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Tue Sep 02, 2014 9:19 pm    Post subject: Reply with quote

UberLord wrote:
deefster wrote:
I guess YMMV, I myself had issues with for example apache trying to fire up before the network was there.


NetworkManager-wait-online.service
or
systemd-networkd-wait-online.service

Someone needs to write a dhcpcd variant of those systemd I guess.

EDIT: Or a better thing would be to patch apache to support the IP_FREEBIND socket option when you need to bind to a dynamic address.


In the meantime I created a dhcpcd-online applet so someone can easily write a dhcpcd-wait-online.service file for systemd.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Sulman
n00b
n00b


Joined: 15 Feb 2014
Posts: 63

PostPosted: Wed Sep 10, 2014 2:49 am    Post subject: Reply with quote

Actually, I found a solution on the Arch wiki.

Using just dhcpd.service can cause a race condition, as outlined here: https://wiki.archlinux.org/index.php/Dhcpcd#dhcpcd_and_systemd_network_interfaces

The solution was to copy the service file with the interface name following the @ symbol:

Code:
cp dhcpcd.service dhcpcd@[interface name].service


You have to reload them or trying to enable the new service will fail (systemd is a binary, remember?)

Code:
systemctl daemon-reload


Then enable the new service unit, and disable the original. This ensures that it's bound to that interface and it behaves itself.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Sep 10, 2014 7:06 am    Post subject: Reply with quote

Sulman wrote:
Actually, I found a solution on the Arch wiki.

Using just dhcpd.service can cause a race condition, as outlined here: https://wiki.archlinux.org/index.php/Dhcpcd#dhcpcd_and_systemd_network_interfaces


dhcpcd has a udev plugin so the race condition can never happen.
If you think it's racing then it's a problem with systemd-udev reporting the wrong things.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Sulman
n00b
n00b


Joined: 15 Feb 2014
Posts: 63

PostPosted: Wed Sep 10, 2014 12:27 pm    Post subject: Reply with quote

UberLord wrote:
Sulman wrote:
Actually, I found a solution on the Arch wiki.

Using just dhcpd.service can cause a race condition, as outlined here: https://wiki.archlinux.org/index.php/Dhcpcd#dhcpcd_and_systemd_network_interfaces


dhcpcd has a udev plugin so the race condition can never happen.
If you think it's racing then it's a problem with systemd-udev reporting the wrong things.


Yes, you're right - that's what the article mentions.
Back to top
View user's profile Send private message
Sulman
n00b
n00b


Joined: 15 Feb 2014
Posts: 63

PostPosted: Wed Sep 10, 2014 3:17 pm    Post subject: Reply with quote

...And it turns out it doesn't work, after many reboot tests. It's blind luck.

I've given up fighting this brave new world and instead have configured systemd-networkd, as God and/or Lennart Poettering intended.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Sep 10, 2014 8:05 pm    Post subject: Reply with quote

Is there anymore context you can post?
I just followed the Gentoo guide to installing systemd (running amd64 stable here) and dhcpcd worked perfectly - admittedly it was started after the interfaces were renamed.

So my questions are these
1) Is your systemd modified anyhow?
2) Is your dhcpcd systsemd service modified anyhow?
3) Can you post a full bootlog (enail me privately if you wish) instead of a snippet?
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Sulman
n00b
n00b


Joined: 15 Feb 2014
Posts: 63

PostPosted: Wed Sep 10, 2014 8:10 pm    Post subject: Reply with quote

UberLord wrote:
Is there anymore context you can post?
I just followed the Gentoo guide to installing systemd (running amd64 stable here) and dhcpcd worked perfectly - admittedly it was started after the interfaces were renamed.

So my questions are these
1) Is your systemd modified anyhow?
2) Is your dhcpcd systsemd service modified anyhow?
3) Can you post a full bootlog (enail me privately if you wish) instead of a snippet?


Sure, if I get a moment I'll try and hunt down a few boot logs.

There's nothing unusual, it's literally a wired ethernet connection with dhcpcd.service enabled (I like the simplicity of it) but udev-systemd appears to periodically cause a snag.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum