You are not logged in.

#1 2012-06-28 19:21:25

csingley
Member
Registered: 2011-05-19
Posts: 5

systemd dhcpcd service failing on boot

Hi folks,

I'm trying to convert my workstation to "pure" systemd configuration (no initscripts-systemd):

[csingley@quadrupel ~]$ pacman -Qs systemd
local/libsystemd 185-3
    systemd client libraries
local/systemd 185-3
    system and service manager
local/systemd-arch-units 20120612-5
    Arch specific Systemd unit files
local/systemd-sysvcompat 185-3
    sysvinit compat for systemd
local/systemd-tools 185-3
    standalone tools from systemd

Per the instructions on the wiki, I enabled dhcpcd@.service, but the service fails to start upon boot.

[root@quadrupel csingley]# 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, 28 Jun 2012 12:36:16 -0500; 39s ago
	 Process: 299 ExecStart=/sbin/dhcpcd -A -q -w %I (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/dhcpcd@.service/eth0

However, I can start the service manually after the boot process is complete:

[root@quadrupel csingley]# systemctl start dhcpcd@eth0.service
[root@quadrupel csingley]# 

Presumably not all dependencies have been satisfied when systemd tries to run dhcpcd during boot.
I'm very new to systemd; any tips for troubleshooting this issue?

TIA

Offline

#2 2012-06-28 19:57:48

89c51
Member
Registered: 2012-06-05
Posts: 672

Re: systemd dhcpcd service failing on boot

I had a configuration with dhcpcd and i remember it failed once or twice but then i installed NetworkManager. (yeah thats not a solution to your problem)

Anything in journalctl that looks weird???

Offline

#3 2012-06-28 19:59:32

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: systemd dhcpcd service failing on boot

Offline

#4 2012-06-29 13:23:04

csingley
Member
Registered: 2011-05-19
Posts: 5

Re: systemd dhcpcd service failing on boot

Here's what the relevant section from journalctl looks like:

Jun 28 21:29:21 quadrupel kernel: e1000e: Intel(R) PRO/1000 Network Driver - 1.9.5-k
Jun 28 21:29:21 quadrupel kernel: e1000e: Copyright(c) 1999 - 2012 Intel Corporation.
Jun 28 21:29:21 quadrupel kernel: e1000e 0000:00:19.0: setting latency timer to 64
Jun 28 21:29:21 quadrupel kernel: e1000e 0000:00:19.0: (unregistered net_device): Interrupt Throttling Rate (ints/sec) set to dynamic conservative mode
Jun 28 21:29:21 quadrupel kernel: e1000e 0000:00:19.0: irq 43 for MSI/MSI-X
<snip>
Jun 28 21:29:21 quadrupel dhcpcd[258]: version 5.5.6 starting
Jun 28 21:29:21 quadrupel dhcpcd[258]: eth0: interface not found or invalid
<snip>
Jun 28 21:29:21 quadrupel systemd[265]: Failed at step EXEC spawning /etc/rc.d/network: No such file or directory
<snip>
Jun 28 21:29:21 quadrupel systemd[1]: dhcpcd@eth0.service: control process exited, code=exited status=1
<snip>
Jun 28 21:29:21 quadrupel systemd[1]: Unit dhcpcd@eth0.service entered failed state.
Jun 28 21:29:21 quadrupel systemd[1]: network.service: main process exited, code=exited, status=203
<snip>
Jun 28 21:29:21 quadrupel systemd[1]: Unit network.service entered failed state.

Why's it trying to execute /etc/rc.d/network?  I've uninstalled initscripts.

Similarly, I'm also getting notices like this:

Jun 28 21:29:21 quadrupel systemd[1]: Cannot add dependency job for unit arch-modules-load.service, ignoring: Unit arch-modules-load.service failed to load: No such file or directory. See system logs and 'systemctl status arch-modules-load.service' for details.
Jun 28 21:29:21 quadrupel systemd[1]: Cannot add dependency job for unit arch-daemons.target, ignoring: Unit arch-daemons.target failed to load: No such file or directory. See system logs and 'systemctl status arch-daemons.target' for details.
Jun 28 21:29:21 quadrupel systemd[1]: Cannot add dependency job for unit rc-local.service, ignoring: Unit rc-local.service failed to load: No such file or directory. See system logs and 'systemctl status rc-local.service' for details.

Hmmm...

Offline

#5 2012-06-29 14:08:34

swanson
Member
From: Sweden
Registered: 2011-02-05
Posts: 759

Re: systemd dhcpcd service failing on boot

Do you still have some daemons in rc.conf? Did you follow some other guide and made units in /etc/systemd/system ? Try to disable the rc.local service with systemctl. I have this for static ip;

[Unit]
Description=Network Connectivity
Requires=sys-devices-pci0000:00-0000:00:04.0-0000:01:06.0-net-eth0.device
After=sys-devices-pci0000:00-0000:00:04.0-0000:01:06.0-net-eth0.device
Wants=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set eth0 up ; /sbin/ip addr add 192.168.1.251/24 dev eth0 ; /sbin/ip route add default via 192.168.1.250
ExecStop=/sbin/ip link set eth0 down

[Install]
WantedBy=multi-user.target

No NM, no wicd, no daemons. Of course you'll have to adapt it for dhcpd. BUT, the first lines "Requires" and "After", ensures that nothing is done until the hardware is seen. Maybe some help ...

Last edited by swanson (2012-06-29 14:09:38)

Offline

#6 2012-06-29 14:33:38

65kid
Member
From: Germany
Registered: 2011-01-26
Posts: 663

Re: systemd dhcpcd service failing on boot

csingley wrote:

Why's it trying to execute /etc/rc.d/network?  I've uninstalled initscripts.

probably because you have network.service from systemd-arch-units still enabled.

csingley wrote:

Similarly, I'm also getting notices like this:

Jun 28 21:29:21 quadrupel systemd[1]: Cannot add dependency job for unit arch-modules-load.service, ignoring: Unit arch-modules-load.service failed to load: No such file or directory. See system logs and 'systemctl status arch-modules-load.service' for details.
Jun 28 21:29:21 quadrupel systemd[1]: Cannot add dependency job for unit arch-daemons.target, ignoring: Unit arch-daemons.target failed to load: No such file or directory. See system logs and 'systemctl status arch-daemons.target' for details.
Jun 28 21:29:21 quadrupel systemd[1]: Cannot add dependency job for unit rc-local.service, ignoring: Unit rc-local.service failed to load: No such file or directory. See system logs and 'systemctl status rc-local.service' for details.

I guess you removed initscripts-systemd but didn't disable the units, so you still have dead symlinks in /etc/systemd/system/multi-user.target.wants/

but all of this has nothing to do with your original problem. look at the bug report that I posted earlier.

Offline

#7 2012-06-29 14:59:44

csingley
Member
Registered: 2011-05-19
Posts: 5

Re: systemd dhcpcd service failing on boot

I guess you removed initscripts-systemd but didn't disable the units, so you still have dead symlinks in /etc/systemd/system/multi-user.target.wants/

Diagnosis correct!  I am beginning to understand how this works a little better.

but all of this has nothing to do with your original problem. look at the bug report that I posted earlier.

65kid, i did check out that bug report.  the patch to the unitfile suggested by falconindy doesn't change my system's misbehavior.

BUT, the first lines "Requires" and "After", ensures that nothing is done until the hardware is seen. Maybe some help ...

LOL - adding a dependency on the net interface to the dhcpcd unit file from community/systemd-arch-units does indeed fix my problem, but hardcoding PCI interface addresses is a fairly rough hack... I'd like to get at the root of the problem here.

Thanks to all - so far I'm pretty impressed by systemd, just trying to wrap my head around it.

Offline

#8 2012-07-30 20:32:01

cmm7825
Member
Registered: 2012-04-08
Posts: 22

Re: systemd dhcpcd service failing on boot

Im also having the same problem on a clean install on virtualbox

Offline

#9 2012-07-31 09:38:56

Revelation60
Member
From: The Netherlands
Registered: 2009-03-19
Posts: 149
Website

Re: systemd dhcpcd service failing on boot

Same for me, not working on virtualbox.

Offline

#10 2012-07-31 09:53:57

Shark
Member
From: /dev/zero
Registered: 2011-02-28
Posts: 663

Re: systemd dhcpcd service failing on boot

csingley wrote:

Hi folks,

I'm trying to convert my workstation to "pure" systemd configuration (no initscripts-systemd):

[csingley@quadrupel ~]$ pacman -Qs systemd
local/libsystemd 185-3
    systemd client libraries
local/systemd 185-3
    system and service manager
local/systemd-arch-units 20120612-5
    Arch specific Systemd unit files
local/systemd-sysvcompat 185-3
    sysvinit compat for systemd
local/systemd-tools 185-3
    standalone tools from systemd

Per the instructions on the wiki, I enabled dhcpcd@.service, but the service fails to start upon boot.

[root@quadrupel csingley]# 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, 28 Jun 2012 12:36:16 -0500; 39s ago
	 Process: 299 ExecStart=/sbin/dhcpcd -A -q -w %I (code=exited, status=1/FAILURE)
	  CGroup: name=systemd:/system/dhcpcd@.service/eth0

However, I can start the service manually after the boot process is complete:

[root@quadrupel csingley]# systemctl start dhcpcd@eth0.service
[root@quadrupel csingley]# 

Presumably not all dependencies have been satisfied when systemd tries to run dhcpcd during boot.
I'm very new to systemd; any tips for troubleshooting this issue?

TIA

You havent enabled but just started the service. If you want to enable it on boot you have to issue command "systemctl enable dhcpcd@eth0.service".
EDIT: Oups, i guess i misread your post. I suppose you have enabled it the way i wrote up. Sorry.

Last edited by Shark (2012-07-31 10:06:27)


If you have built castles in the air, your work need not be lost; that is where they should be. Now put foundations under them.
Henry David Thoreau

Registered Linux User: #559057

Offline

#11 2012-09-04 21:23:24

luvfree
Member
Registered: 2012-08-29
Posts: 80

Re: systemd dhcpcd service failing on boot

@csingley
I too had this problem after installing kde.
Deleting all files in /var/log/journal and then running,
sudo systemctl start dhcpcd@eth0.service
and then running,
sudo systemctl enable dhcpcd@eth0.service
seems to have fixed the issue.
still working after several reboots and hopefully from now on.
this also fixed two other problems I was having as well.
cairo-dock starting 2 instances and strange mouse cursor behavior.
hope this helps you too.

Last edited by luvfree (2012-09-04 21:27:16)


Currently triple booting Arch Linux, Sabayon 10, and Ubuntu 12.04 from scratch...

Offline

#12 2012-09-05 07:59:03

dj-x-cess
Member
Registered: 2012-02-16
Posts: 4

Re: systemd dhcpcd service failing on boot

I have the same problem.

It seems, at least for my machine, dhcpcd starts before eth0 gets initialized on boot time:

Sep 05 07:38:39 vostro dhcpcd[180]: version 5.6.0 starting
Sep 05 07:38:39 vostro dhcpcd[180]: eth0: interface not found or invalid
Sep 05 07:38:39 vostro kernel: r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
Sep 05 07:38:39 vostro kernel: r8169 0000:13:00.0: irq 47 for MSI/MSI-X
Sep 05 07:38:39 vostro kernel: r8169 0000:13:00.0: eth0: RTL8168d/8111d at 0xf9c00000, a4:ba:db:a6:a6:33, XID 083000c0 IRQ 47
Sep 05 07:38:39 vostro kernel: r8169 0000:13:00.0: eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]

Offline

#13 2012-09-05 14:53:00

Stebalien
Member
Registered: 2010-04-27
Posts: 1,227
Website

Re: systemd dhcpcd service failing on boot

Don't use the pci device. Network devices are aliased to 'sys-subsystem-net-devices-<interface-name>.device'. That is, use the unit from the bug report but add:

After=sys-subsystem-net-devices-%i.device

Last edited by Stebalien (2012-09-05 14:56:46)


Steven [ web : git ]
GPG:  327B 20CE 21EA 68CF A7748675 7C92 3221 5899 410C
Do not email: honeypot@stebalien.com

Offline

#14 2012-09-08 20:37:19

yuumei
Member
From: London, England
Registered: 2012-08-08
Posts: 8

Re: systemd dhcpcd service failing on boot

I had the same problem, tried using the

After=sys-subsystem-net-devices-%i.device

but that didn't work, it was still doing dhcp before the device was up. Had to use Requires= and After= with the sys-devices-pci device


cpu: i7-3770K; mb: DZ77GA-70K (warning, very buggy); ssd: intel 320 60Gb

Offline

#15 2012-11-15 09:47:36

hdagelic
Member
Registered: 2012-11-15
Posts: 1

Re: systemd dhcpcd service failing on boot

dj-x-cess wrote:

I have the same problem.

It seems, at least for my machine, dhcpcd starts before eth0 gets initialized on boot time:

Sep 05 07:38:39 vostro dhcpcd[180]: version 5.6.0 starting
Sep 05 07:38:39 vostro dhcpcd[180]: eth0: interface not found or invalid
Sep 05 07:38:39 vostro kernel: r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
Sep 05 07:38:39 vostro kernel: r8169 0000:13:00.0: irq 47 for MSI/MSI-X
Sep 05 07:38:39 vostro kernel: r8169 0000:13:00.0: eth0: RTL8168d/8111d at 0xf9c00000, a4:ba:db:a6:a6:33, XID 083000c0 IRQ 47
Sep 05 07:38:39 vostro kernel: r8169 0000:13:00.0: eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]

Yes. Same thing here with the latest install. I put "tg3" in /etc/modules-load.d/tigon.conf. Guess it loads it sooner then and now it gets an IP. Couldn't you make dhcpcd wait for eth0 to come up? It looks important, I mean dhcp should work smile I'm a newbie with Arch, installed it for the first time.

Here are my logs before the fix (I was looking in /var/log/, but then I found out that there is a journalctl command):

Nov 14 15:33:40 neimastina dhcpcd[176]: version 5.6.2 starting
Nov 14 15:33:40 neimastina dhcpcd[176]: eth0: interface not found or invalid
Nov 14 15:33:44 neimastina systemd[1]: dhcpcd@eth0.service: control process exited, code=exited status=1
Nov 14 15:33:45 neimastina kernel: EDAC MC: Ver: 3.0.0
Nov 14 15:33:45 neimastina kernel: wmi: Mapper loaded
Nov 14 15:33:45 neimastina kernel: iTCO_vendor_support: vendor-support=0
Nov 14 15:33:45 neimastina kernel: tg3.c:v3.124 (March 21, 2012)
Nov 14 15:33:45 neimastina kernel: EDAC MC0: Giving out device to 'x38_edac' 'x38': DEV 0000:00:00.0
Nov 14 15:33:45 neimastina kernel: tg3 0000:34:00.0: eth0: Tigon3 [partno(BCM95751A519FLP) rev 4201] (PCI Express) MAC address 00:10:18:53:12:b7
Nov 14 15:33:45 neimastina kernel: tg3 0000:34:00.0: eth0: attached PHY is 5750 (10/100/1000Base-T Ethernet) (WireSpeed[1], EEE[0])
Nov 14 15:33:45 neimastina kernel: tg3 0000:34:00.0: eth0: RXcsums[1] LinkChgREG[0] MIirq[0] ASF[0] TSOcap[1]
Nov 14 15:33:45 neimastina kernel: tg3 0000:34:00.0: eth0: dma_rwctrl[76180000] dma_mask[64-bit]
Nov 14 15:33:45 neimastina kernel: gpio_ich: GPIO from 195 to 255 on gpio_ich

Offline

#16 2012-11-22 03:45:23

solar
Member
Registered: 2011-03-01
Posts: 75

Re: systemd dhcpcd service failing on boot

The solution is pretty simple and requires little effort. here at least.

*for some reason, pointing to the symlink in /usr/sbin/ rather than the actual /sbin/dhcpcd makes it work here*


DEBUGGING:
#> which dhcpcd
/usr/sbin/dhcpcd

SOLUTION:
sudo nano /usr/lib/systemd/system/dhcpcd@.service

and prepend /usr to the erronous path /sbin/dhcpcd

Voila. very simple, and to troubleshoot a service file, one can always add set -e -u -x or whatever one likes.

EDIT: hmm, ok, just to make sure, refresh the symlink:
sudo reenable systemctl dhcpcd@eth0

(if still being lame, do a disable + enable).

solar

Last edited by solar (2012-11-22 03:57:09)


I am hilariously insane. yup. you won't notice though.. I promise...I think.

Offline

Board footer

Powered by FluxBB