You are not logged in.

#1 2012-10-30 08:15:35

chuchuqa
Member
Registered: 2012-10-30
Posts: 31

[SOLVED] dhcpcd not working with systemd

I added module r8169 in /etc/modules-load.d/realtek.conf (despite it is loaded automatically without manual adding)
I enabled dhcpcd@eth0.service
I tried to hack upon service file according to https://bugs.archlinux.org/task/30235
but it still fails and I have to start it manually.

What info needed?

Last edited by chuchuqa (2012-11-08 08:52:55)

Offline

#2 2012-10-30 08:52:23

hadrons123
Member
From: chennai
Registered: 2011-10-07
Posts: 1,249

Re: [SOLVED] dhcpcd not working with systemd

What is the output you get for

systemctl status dhcpd@eth0.service

LENOVO Y 580 IVYBRIDGE 660M NVIDIA
Unix is user-friendly. It just isn't promiscuous about which users it's friendly with. - Steven King

Offline

#3 2012-10-30 08:54:28

chuchuqa
Member
Registered: 2012-10-30
Posts: 31

Re: [SOLVED] dhcpcd not working with systemd

hadrons123 wrote:

What is the output you get for

systemctl status dhcpd@eth0.service
% sudo systemctl status dhcpcd@eth0.service
dhcpcd@eth0.service - dhcpcd on eth0
	  Loaded: loaded (/usr/lib/systemd/system/dhcpcd@.service; enabled)
	  Active: failed (Result: exit-code) since Tue, 2012-10-30 12:46:56 MSK; 1min 1s ago
	 Process: 333 ExecStart=/sbin/dhcpcd -A -q -w %I (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/dhcpcd@.service/eth0

Oct 30 12:46:27 big dhcpcd[333]: eth0: sendmsg: Cannot assign requested address
Oct 30 12:46:27 big dhcpcd[333]: eth0: rebinding lease of 10.35.1.10
Oct 30 12:46:31 big dhcpcd[333]: eth0: sending IPv6 Router Solicitation
Oct 30 12:46:32 big dhcpcd[333]: eth0: broadcasting for a lease
Oct 30 12:46:35 big dhcpcd[333]: eth0: sending IPv6 Router Solicitation
Oct 30 12:46:39 big dhcpcd[333]: eth0: sending IPv6 Router Solicitation
Oct 30 12:46:39 big dhcpcd[333]: eth0: no IPv6 Routers available
Oct 30 12:46:56 big dhcpcd[333]: timed out
Oct 30 12:46:56 big systemd[1]: Failed to start dhcpcd on eth0.
Oct 30 12:46:56 big systemd[1]: Unit dhcpcd@eth0.service entered failed state

Offline

#4 2012-10-30 09:08:34

chuchuqa
Member
Registered: 2012-10-30
Posts: 31

Re: [SOLVED] dhcpcd not working with systemd

Journalctl:

Oct 30 12:46:25 big dhcpcd[333]: version 5.6.2 starting
Oct 30 12:46:26 big dhcpcd[333]: eth0: waiting for carrier
Oct 30 12:46:27 big dhcpcd[333]: eth0: carrier acquired
Oct 30 12:46:27 big dhcpcd[333]: eth0: sending IPv6 Router Solicitation
Oct 30 12:46:27 big dhcpcd[333]: eth0: sendmsg: Cannot assign requested address
Oct 30 12:46:27 big dhcpcd[333]: eth0: rebinding lease of 10.35.1.10
Oct 30 12:46:28 big kernel: r8169 0000:03:00.0: eth0: link down
Oct 30 12:46:28 big kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Oct 30 12:46:28 big kernel: r8169 0000:03:00.0: eth0: link down
Oct 30 12:46:28 big systemd-logind[335]: Watching system buttons on /dev/input/event4 (Power Button)
Oct 30 12:46:28 big systemd-logind[335]: Watching system buttons on /dev/input/event3 (Power Button)
Oct 30 12:46:28 big kernel: r8169 0000:03:00.0: eth0: link up
Oct 30 12:46:28 big kernel: IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Oct 30 12:46:31 big dhcpcd[333]: eth0: sending IPv6 Router Solicitation
Oct 30 12:46:32 big dhcpcd[333]: eth0: broadcasting for a lease
Oct 30 12:46:35 big dhcpcd[333]: eth0: sending IPv6 Router Solicitation
Oct 30 12:46:39 big dhcpcd[333]: eth0: sending IPv6 Router Solicitation
Oct 30 12:46:39 big dhcpcd[333]: eth0: no IPv6 Routers available
Oct 30 12:46:44 big xdm[362]: pam_unix(xdm:session): session opened for user username by username(uid=0)
Oct 30 12:46:44 big systemd-logind[335]: New session 1 of user username.
Oct 30 12:46:44 big systemd-logind[335]: Linked /tmp/.X11-unix/X0 to /run/user/1000/X11-display.
Oct 30 12:46:44 big dbus-daemon[334]: dbus[334]: [system] Activating via systemd: service name='org.freedesktop.ConsoleKit' unit='console-kit-daemon.service'
Oct 30 12:46:44 big dbus[334]: [system] Activating via systemd: service name='org.freedesktop.ConsoleKit' unit='console-kit-daemon.service'
Oct 30 12:46:44 big systemd[1]: Starting Console Manager...
Oct 30 12:46:44 big console-kit-daemon[369]: missing action
Oct 30 12:46:44 big dbus-daemon[334]: dbus[334]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Oct 30 12:46:44 big dbus[334]: [system] Activating service name='org.freedesktop.PolicyKit1' (using servicehelper)
Oct 30 12:46:44 big polkitd[436]: started daemon version 0.105 using authority implementation `local' version `0.105'
Oct 30 12:46:44 big dbus-daemon[334]: dbus[334]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Oct 30 12:46:44 big dbus[334]: [system] Successfully activated service 'org.freedesktop.PolicyKit1'
Oct 30 12:46:44 big dbus-daemon[334]: dbus[334]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
Oct 30 12:46:44 big dbus[334]: [system] Successfully activated service 'org.freedesktop.ConsoleKit'
Oct 30 12:46:44 big systemd[1]: Started Console Manager.
Oct 30 12:46:56 big dhcpcd[333]: timed out
Oct 30 12:46:56 big systemd[1]: dhcpcd@eth0.service: control process exited, code=exited status=1
Oct 30 12:46:56 big systemd[1]: Failed to start dhcpcd on eth0.
Oct 30 12:46:56 big systemd[1]: Unit dhcpcd@eth0.service entered failed state
Oct 30 12:46:56 big systemd[1]: Starting Multi-User.
Oct 30 12:46:56 big systemd[1]: Reached target Multi-User.
Oct 30 12:46:56 big systemd[1]: Starting Graphical Interface.
Oct 30 12:46:56 big systemd[1]: Reached target Graphical Interface.
Oct 30 12:46:56 big systemd[1]: Starting Update UTMP about System Runlevel Changes...
Oct 30 12:46:56 big systemd[1]: Starting Network.
Oct 30 12:46:56 big systemd[1]: Reached target Network.
Oct 30 12:46:56 big systemd[1]: Started Update UTMP about System Runlevel Changes.
Oct 30 12:46:56 big systemd[1]: Startup finished in 4s 358ms 629us (kernel) + 34s 614ms 825us (userspace) = 38s 973ms 454us.

Last edited by chuchuqa (2012-10-30 09:09:37)

Offline

#5 2012-10-30 15:24:11

hadrons123
Member
From: chennai
Registered: 2011-10-07
Posts: 1,249

Re: [SOLVED] dhcpcd not working with systemd

Sorry. I didn't read your post well. I thought it was dhcp, but now I found that you are using dhcpcd.

I had trouble using dhcp and finally figured it out. I don't have much of a clue about dhcpcd.

All I had to do was install dhcp package and set it up like this

ip link set eth0 up
dhcpd eth0

Did you try dhcp or dhclient ?


LENOVO Y 580 IVYBRIDGE 660M NVIDIA
Unix is user-friendly. It just isn't promiscuous about which users it's friendly with. - Steven King

Offline

#6 2012-11-01 15:34:19

chuchuqa
Member
Registered: 2012-10-30
Posts: 31

Re: [SOLVED] dhcpcd not working with systemd

I just looked a little deeper. r8169 is automatically loaded and everything works fine, but

$lspci |grep net
03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

$lsmod |grep r8
r8169                  56839  0 
mii                     4091  1 r8169

maybe https://www.archlinux.org/packages/comm … _64/r8168/ needed to properly start.

Offline

#7 2012-11-01 19:27:13

tladuke
Member
Registered: 2009-07-23
Posts: 171

Re: [SOLVED] dhcpcd not working with systemd

dhcp is a dhcp server.

You could try netcfg instead of dhcpcd@eth0 and see if it just works instead of hacking on service files.

Last edited by tladuke (2012-11-01 19:27:31)

Offline

#8 2012-11-01 19:51:49

albeec13
Member
Registered: 2012-10-18
Posts: 2

Re: [SOLVED] dhcpcd not working with systemd

I've been wrestling with this all day, and tried every possible solution to no avail.  I think I found one solution buried somewhere in the dhcpcd bug reports that seems to have helped.

I modified the dhcpcd@.service file to include the parameter "-t 120" in the call to dhcpcd.  It appears it's taking over a minute to get an IP (i'm not sure what the root cause of this is) causing dhcpcd to time out on boot.  Adding "-t 120" to the call increases the timeout to 2 minutes from the default one minute, and seems to have helped me.

Currently I've also added the BindsTo/After=sys-subsystem-net-devices-%i.device to my service file as well, and I've added "tg3.conf" containing "tg3" to "/etc/modules-load.d/", but those alone had no effect until I increased the timeout.  I'm leaving them in place at the moment, because it's working and I don't want to mess with it, but I think they have no effect.

Try increasing the timeout and see if it helps.  Initially I used "-t 0", but that's an infinite timeout period which would cause systemd to wait forever, so once I looked at the logs to see the average time to get an address, I changed the timeout to something larger than that, so it will fail gracefully.

Good luck.

Offline

#9 2012-11-02 11:11:03

chuchuqa
Member
Registered: 2012-10-30
Posts: 31

Re: [SOLVED] dhcpcd not working with systemd

Thanks a lot. I'll give it a try!

Last edited by chuchuqa (2012-11-02 11:12:01)

Offline

#10 2012-11-08 08:51:58

chuchuqa
Member
Registered: 2012-10-30
Posts: 31

Re: [SOLVED] dhcpcd not working with systemd

Added "-t 120" . Everything is fine now.

Offline

Board footer

Powered by FluxBB