You are not logged in.

#1 2012-11-15 11:25:20

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Dhcpcd does not start automatically on boot

Hi everyone,

I have just installed Arch (64 bit) and am running on a dynamic, wired connection.

I followed the Beginners' Guide and enabled the dhcpcd service during the installation so that it would start automatically on boot.

systemctl enable dhcpcd@eth0.service

However, I currently must issue the command "dhcpcd" each boot before the internet starts to work.

Does anyone know how I can automate this process or if I need to further configure my network connection?

Thank you in advance.

Last edited by Ipozya (2012-11-15 11:29:05)

Offline

#2 2012-11-15 14:22:01

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

Re: Dhcpcd does not start automatically on boot

I shall tell you a workaround which i used.

1.I installed dhclient.
2. I set it up like

ip link set eth0 up

3.finally

dhclient eth0

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-11-15 15:03:45

foppe
Member
Registered: 2011-04-02
Posts: 47

Re: Dhcpcd does not start automatically on boot

Check the output from

# systemctl status dhcpcd@eth0.service

to debug the issue you're experiencing.

Offline

#4 2012-11-15 20:45:42

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Re: Dhcpcd does not start automatically on boot

foppe wrote:

Check the output from

# systemctl status dhcpcd@eth0.service

to debug the issue you're experiencing.

% 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-11-15 20:38:16 GMT; 27 sec ago
	 Process: 244 ExecStart=/sbin/dhcpcd -A -q -w %I (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/dhcpcd@.service/eth0

Nov 15 20:37:47 arch dhcpcd[244]: eth0: sending IPv6 Router Solicitation
Nov 15 20:37:47 arch dhcpcd[244]: eth0: sendmsg: Cannot assign requested address
Nov 15 20:37:47 arch dhcpcd[244]: eth0: broadcasting for a lease
Nov 15 20:37:51 arch dhcpcd[244]: eth0: sending IPv6 Router Solicitation
Nov 15 20:37:55 arch dhcpcd[244]: eth0: sending IPv6 Router Solicitation
Nov 15 20:37:59 arch dhcpcd[244]: eth0: sending IPv6 Router Solicitation
Nov 15 20:37:59 arch dhcpcd[244]: eth0: no IPv6 Routers available
Nov 15 20:38:16 arch dhcpcd[244]: timed out
Nov 15 20:38:16 arch systemd[1]: Failed to start dhcpcd on eth0.
Nov 15 20:38:16 arch systemd[1]: Unit dhcpcd@eth0.service entered failed state

Dhclient did not work automatically on boot either.

Others seem to have experienced similar issues but I don't see any real solutions in any of these posts, despite being marked as solved. For example, adding "-t 120" to the dhcpcd start line in /usr/lib/systemd/system/dhcpcd@.service did not work for me.

I also tried the following but it did not work either and I had to issue "dhcpcd" before internet started working.

Install and configure wired and wireless networking

# pacman -S netcfg ifplugd
# cd /etc/network.d
# ln -s examples/ethernet-dhcp .

Make sure the WIRED_INTERFACE and WIRELESS_INTERFACE lines is uncommented
# nano /etc/conf.d/netcfg

# systemctl enable net-auto-wired.service
# pacman -S wireless_tools wpa_supplicant wpa_actiond dialog
# systemctl enable net-auto-wireless.service

https://bbs.archlinux.org/viewtopic.php?pid=1176656
https://bbs.archlinux.org/viewtopic.php?pid=1189587
https://bbs.archlinux.org/viewtopic.php?pid=1180192

Last edited by Ipozya (2012-11-15 21:08:03)

Offline

#5 2012-11-15 23:13:20

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Dhcpcd does not start automatically on boot

As I understand it, this should not be necessary but I have to disable ipv6 to get access at work. The way I think I do this right now is by having:

net.ipv6.conf.all.disable_ipv6 = 1

at the end of /etc/sysctl.conf. Basically, otherwise it only ever tries ipv6 and if your network only has ipv4, it just gives up and fails.

(I believe the network should respond in a way which prevents this - it works for me at home but at work, I need it disabled.)

On the other hand, I don't know why it would then work manually if this was the problem... just the errors looked familiar.

Last edited by cfr (2012-11-15 23:14:13)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2012-11-16 02:18:43

ismaelvc
Member
From: México, D.F.
Registered: 2012-02-26
Posts: 136

Re: Dhcpcd does not start automatically on boot

I am also having the same problem dhcpcd service fails almost allways to connect me on boot, but after logging in and runing

sudo dhcpcd

everything is fine.

ismaelvc@toybox ~ $ 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 Thu, 2012-11-15 17:57:26 CST; 2h 16min ago
 Process: 118 ExecStart=/sbin/dhcpcd -A -q -w %I (code=exited, status=1/FAILURE)
  CGroup: name=systemd:/system/dhcpcd@.service/eth0

EDIT: By the way arch installation cd (from october), never fails to connect on boot.

output of dhcpcd:

ismaelvc@toybox ~ $ connect
[sudo] password for ismaelvc: 
dhcpcd[477]: version 5.6.2 starting
dhcpcd[477]: eth0: sending IPv6 Router Solicitation
dhcpcd[477]: eth0: sendmsg: Cannot assign requested address
dhcpcd[477]: eth0: rebinding lease of 192.168.0.3
dhcpcd[477]: eth0: acknowledged 192.168.0.3 from 192.168.0.1
dhcpcd[477]: eth0: checking for 192.168.0.3
dhcpcd[477]: eth0: sending IPv6 Router Solicitation
dhcpcd[477]: eth0: leased 192.168.0.3 for 3600 seconds
dhcpcd[477]: forked to background, child pid 504

I think is this one: dhcpcd[477]: eth0: sendmsg: Cannot assign requested address

Last edited by ismaelvc (2012-11-16 03:10:29)


Laptop: LG LM70 Express                                                  Kernel: 3.14.2-1-ARCH   
CPU: Intel Pentium M processor @1.86GHz                  Hard Drive: 80G
Video: Mobility Radeon X600                                            X Driver: xf86-video-ati
Memory Size: 1.5G + zramswap: 384M + swap: 3G

Offline

#7 2012-11-16 20:30:19

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Re: Dhcpcd does not start automatically on boot

cfr wrote:

As I understand it, this should not be necessary but I have to disable ipv6 to get access at work. The way I think I do this right now is by having:

net.ipv6.conf.all.disable_ipv6 = 1

at the end of /etc/sysctl.conf. Basically, otherwise it only ever tries ipv6 and if your network only has ipv4, it just gives up and fails.

(I believe the network should respond in a way which prevents this - it works for me at home but at work, I need it disabled.)

On the other hand, I don't know why it would then work manually if this was the problem... just the errors looked familiar.

Thanks, but it did not work. Any other ideas? Like ismaelvc, my ethernet connection started up automatically when I booted the installation CD and installed arch.

Last edited by Ipozya (2012-11-16 20:34:06)

Offline

#8 2012-11-16 22:03:42

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Dhcpcd does not start automatically on boot

Does it change the error messages, though?

Do you know if your network supports ipv6? Because the messages suggest that it is only trying ipv6 and not falling back to ipv4.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-11-16 22:57:32

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Re: Dhcpcd does not start automatically on boot

cfr wrote:

Does it change the error messages, though?

Do you know if your network supports ipv6? Because the messages suggest that it is only trying ipv6 and not falling back to ipv4.

No - causes same error messages except that it's process 245 instead of 244.

Not sure if this is any useful, but this is what it shows when I type dhcpcd in root to get ethernet started manually:

#dhcpcd
dhcpcd[386]: version 5.6.2 starting
dhcpcd[386]: wlan0: up_interface: Operation not possible due to RF-kill
dhcpcd[386]: eth0: sending IPv6 Router Solicitation
dhcpcd[386]: eth0: sendmsg: Network is unreachable
dhcpcd[386]: eth0: rebinding lease of 157.142.173.203
dhcpcd[386]: wlan0: waiting for carrier
dhcpcd[386]: eth0: sending IPv6 Router Solicitation
dhcpcd[386]: eth0: sendmsg: Network is unreachable
dhcpcd[386]: eth0: acknowledged 157.142.173.203 from 157.142.223.170
dhcpcd[386]: eth0: checking for 157.142.173.203
dhcpcd[386]: eth0: sending IPv6 Router Solicitation
dhcpcd[386]: eth0: sendmsg: Network is unreachable
dhcpcd[386]: eth0: leased 157.142.173.203 for 720 seconds
dhcpcd[386]: forked to background, child pid 422

Offline

#10 2012-11-16 23:10:24

bones
Member
From: Brisbane
Registered: 2006-03-24
Posts: 322
Website

Re: Dhcpcd does not start automatically on boot

I to just experienced the same problem. I had just done an update, turned off computer. When I came back and turned it back on dhcpcd wouldn't start. Done a quick check by downgrading the packages that were updated and all was working again. Haven't narrowed it down yet but these were the packages that were updated.

binutils-2.23-1 => binutils-2.23.1-1
telepathy-qt-0.9.3-1 => telepathy-qt-0.9.3-2

Me thinks maybe binutils could be the problem. Going to just update again and see what happens


"When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return."

Offline

#11 2012-11-17 00:01:14

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Re: Dhcpcd does not start automatically on boot

Did you identify if this was the problem? If so, should there not a be a lot more people experiencing this issue - I don't see a thread in the Pacman/upgrades section

Last edited by Ipozya (2012-11-17 00:02:06)

Offline

#12 2012-11-17 00:09:34

bones
Member
From: Brisbane
Registered: 2006-03-24
Posts: 322
Website

Re: Dhcpcd does not start automatically on boot

Ipozya wrote:

Did you identify if this was the problem? If so, should there not a be a lot more people experiencing this issue - I don't see a thread in the Pacman/upgrades section

Nope. Scratch that one. Still looking at what could be the problem. I kinda stumped on this as everything was working fine up until today. Even my laptop is playing up. KDM comes up but that's as far as it goes


"When once you have tasted flight, you will forever walk the earth with your eyes turned skyward, for there you have been, and there you will always long to return."

Offline

#13 2012-11-17 00:17:04

guyht
Member
Registered: 2012-11-16
Posts: 4

Re: Dhcpcd does not start automatically on boot

I am also experiencing this issue off a fresh install of Arch linux

Offline

#14 2012-11-17 01:08:43

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Dhcpcd does not start automatically on boot

Maybe try getting additional information from the journal/logs. I would try to figure out what command exactly the service ends up trying to execute in the case when it fails on boot and the case where it succeeds when started manually. I can't see why this should make a difference but something obviously does. systemctl status is only showing you the end of the messages. You probably need to see more to see what is happening. (At least, that's what I would try.)

Was the October iso using initscripts or systemd? If the former, it will not tell you much that that works. The latter possibility might be more interesting.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2012-11-17 01:11:43

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Re: Dhcpcd does not start automatically on boot

https://www.archlinux.org/news/install- … s-systemd/

October iso is the one that introduced systemd and I installed with november which also used systemd.

Will try to see in logs if I can get additional information.

Last edited by Ipozya (2012-11-17 01:11:58)

Offline

#16 2012-11-17 09:19:59

anarcho
Member
From: England
Registered: 2012-11-16
Posts: 33
Website

Re: Dhcpcd does not start automatically on boot

I have a similar problem as dhcpcd doesn't start on reboot and is a fresh install with Nov release

  # 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 Sat, 2012-11-17 09:03:58 GMT; 6min ago
	  CGroup: name=systemd:/system/dhcpcd@.service/eth0

Nov 17 09:03:28 ace dhcpcd[262]: eth0: carrier acquired
Nov 17 09:03:28 ace dhcpcd[262]: eth0: carrier lost
Nov 17 09:03:28 ace dhcpcd[262]: eth0: waiting for carrier
Nov 17 09:03:58 ace systemd[1]: Failed to start dhcpcd on eth0.
Nov 17 09:03:58 ace systemd[1]: Unit dhcpcd@eth0.service entered failed state

 # systemctl status dhcpcd@eth1.service
dhcpcd@eth1.service - dhcpcd on eth1
	  Loaded: loaded (/usr/lib/systemd/system/dhcpcd@.service; enabled)
	  Active: inactive (dead)
	  CGroup: name=systemd:/system/dhcpcd@.service/eth1

 # ping -c 3 www.google.com
ping: unknown host www.google.com

 # dhcpcd
dhcpcd[528]: version 5.6.2 starting
dhcpcd[528]: eth1: sending IPv6 Router Solicitation
dhcpcd[528]: eth1: sendmsg: Cannot assign requested address
dhcpcd[528]: eth1: rebinding lease of 192.168.0.2
dhcpcd[528]: eth0: waiting for carrier
dhcpcd[528]: eth1: carrier lost
dhcpcd[528]: eth1: carrier acquired
dhcpcd[528]: eth1: sending IPv6 Router Solicitation
dhcpcd[528]: eth1: sendmsg: Cannot assign requested address
dhcpcd[528]: eth1: rebinding lease of 192.168.0.2
dhcpcd[528]: eth1: acknowledged 192.168.0.2 from 192.168.0.1
dhcpcd[528]: eth1: checking for 192.168.0.2
dhcpcd[528]: eth1: sending IPv6 Router Solicitation
dhcpcd[528]: eth1: leased 192.168.0.2 for 3600 seconds
dhcpcd[528]: forked to background, child pid 574

Offline

#17 2012-11-17 23:59:00

jv2112
Member
Registered: 2011-07-23
Posts: 160

Re: Dhcpcd does not start automatically on boot

Just thinking out loud. But if it works when mannualy done but not durring boot I would think it is depending on a service which is loading after dhcpd.

How do you view / control the service order in Systemd ? hmm


Life is pleasant. Death is peaceful. It's the transition that's troublesome. Isaac Asimov - / -

Offline

#18 2012-11-18 00:55:06

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Dhcpcd does not start automatically on boot

There are fancy ways but I tend to read the service file:

$ less /usr/lib/systemd/system/dhcpcd\@.service 
[Unit]
Description=dhcpcd on %I
Wants=network.target
Before=network.target

[Service]
Type=forking
PIDFile=/run/dhcpcd-%I.pid
ExecStart=/sbin/dhcpcd -A -q -w %I
ExecStop=/sbin/dhcpcd -k %I

[Install]
Alias=multi-user.target.wants/dhcpcd@eth0.service

CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#19 2012-11-18 13:22:10

jv2112
Member
Registered: 2011-07-23
Posts: 160

Re: Dhcpcd does not start automatically on boot

cfr,

Thanks for the insight. smile



Ipozya ,

Please post yours.

Mine -->  and it works for me.

[Unit]
Description=dhcpcd on %I
Wants=network.target
Before=network.target

[Service]
Type=forking
PIDFile=/run/dhcpcd-%I.pid
ExecStart=/sbin/dhcpcd -A -q -w %I
ExecStop=/sbin/dhcpcd -k %I

[Install]
Alias=multi-user.target.wants/dhcpcd@eth0.service

Life is pleasant. Death is peaceful. It's the transition that's troublesome. Isaac Asimov - / -

Offline

#20 2012-11-18 18:19:41

Ipozya
Member
Registered: 2011-01-20
Posts: 52

Re: Dhcpcd does not start automatically on boot

jv2112 wrote:

Just thinking out loud. But if it works when mannualy done but not durring boot I would think it is depending on a service which is loading after dhcpd.

How do you view / control the service order in Systemd ? hmm

I am starting to sense that this is a bug as several users in this thread are reporting the same issue and other threads are coming up as well:

https://bbs.archlinux.org/viewtopic.php?id=152609
https://bbs.archlinux.org/viewtopic.php?id=151662

Could possibly be the following bug (https://mailman.archlinux.org/pipermail … 03331.html)

Thomas Bächler wrote:

Our current systemd units have a fatal flaw: They may fail because they
are started before the needed devices show up. This patch series adds
new units that fix that. However, the change is not transparent for the
user and requires different configuration.

I'd really like to deprecate netcfg.service, netcfg at .service and
net-auto-wireless.service at some point, but that will break existing
setups. I don't know if we should go ahead with this.

Anyway, please comment on the patches.

My service file looks identical:

[Unit]
Description=dhcpcd on %I
Wants=network.target
Before=network.target

[Service]
Type=forking
PIDFile=/run/dhcpcd-%I.pid
ExecStart=/sbin/dhcpcd -A -q -w %I
ExecStop=/sbin/dhcpcd -k %I

[Install]
Alias=multi-user.target.wants/dhcpcd@eth0.service

Offline

#21 2012-11-18 22:34:21

phil
Member
Registered: 2012-09-22
Posts: 72

Re: Dhcpcd does not start automatically on boot

I encounter the same problem, but with wifi.
My service file looks exactly the same.

Offline

#22 2012-11-19 00:15:53

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Dhcpcd does not start automatically on boot

phil wrote:

I encounter the same problem, but with wifi.
My service file looks exactly the same.

But I doubt that file is relevant to you. "eth0" is *usually* a wired connection. If this is actually your wireless, that is unusual and you would need to account for this.

I think if you are having trouble with wifi *after* reading the relevant wiki pages and searching the forums, you should start a new thread. Make sure you include relevant information about your system, config and network.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#23 2012-11-19 00:57:25

phil
Member
Registered: 2012-09-22
Posts: 72

Re: Dhcpcd does not start automatically on boot

Well, I think it has to do with the same thing.

I cannot establish a wifi connection using wicd. It says "not connected" directly after it tries to get an IP. If I use static IP's, I can connect to the router.
After I run "sudo dhcpcd" after startup, it connects just fine. I'll have an eye on that threat and on that bug.

Offline

#24 2012-11-19 01:19:20

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: Dhcpcd does not start automatically on boot

In that case, you are not starting dhcpcd in the same way. Those in this thread start using the service file and it works after start up. In their case, it should be started by systemd. You are starting dhcpcd directly when it should be started (I think) by wicd. In your case, wicd should be started by systemd on boot. Is *that* service enabled?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#25 2012-11-19 01:31:11

phil
Member
Registered: 2012-09-22
Posts: 72

Re: Dhcpcd does not start automatically on boot

OK, what you say makes perfect sense.
The wicd.service is running without problems:

systemctl status wicd.service 
wicd.service - Wicd a wireless and wired network manager for Linux
	  Loaded: loaded (/usr/lib/systemd/system/wicd.service; enabled)
	  Active: active (running) since Sun, 2012-11-18 20:24:39 EST; 1min 3s ago
	Main PID: 345 (wicd)
	  CGroup: name=systemd:/system/wicd.service
		  ├ 345 /usr/bin/python2 -O /usr/share/wicd/daemon/wicd-daemon.py --no-daemon
		  └ 398 /usr/bin/python2 -O /usr/share/wicd/daemon/monitor.py

Allthough this seems not good, but there is no ethernet cable  plugged in:

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 Sun, 2012-11-18 20:25:04 EST; 1min 40s ago
	 Process: 344 ExecStart=/sbin/dhcpcd -A -q -w %I (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/dhcpcd@.service/eth0

Nov 18 20:24:34 philipp dhcpcd[344]: eth0: waiting for carrier
Nov 18 20:25:04 philipp systemd[1]: Failed to start dhcpcd on eth0.
Nov 18 20:25:04 philipp systemd[1]: Unit dhcpcd@eth0.service entered failed state

Is there some dhcpcd service? Because I cannot find/ start/ enable one.

Offline

Board footer

Powered by FluxBB