You are not logged in.

#1 2013-01-30 16:38:39

Archimaredes
Member
Registered: 2013-01-23
Posts: 50

Netcfg profile sometimes fails to start on boot

Hey,

I have a Ethernet connection with DHCP to my router, and I use a netcfg profile for it. I have systemd set to start the profile's service on boot, but approximately 1 out of 3 times it fails and I get this:

netcfg@ethernet-dhcp.service - Netcfg networking service for profile ethernet-dhcp
	  Loaded: loaded (/usr/lib/systemd/system/netcfg@.service; enabled)
	  Active: failed (Result: exit-code) since Wed 2013-01-30 16:28:27 UTC; 1min 9s ago
	 Process: 204 ExecStart=/usr/bin/netcfg check-iface %i (code=exited, status=1/FAILURE)

Jan 30 16:28:27 hostname netcfg[204]: :: ethernet-dhcp up Interface enp4s0 does not exist
Jan 30 16:28:27 hostname netcfg[204]: [fail]
Jan 30 16:28:27 hostname systemd[1]: netcfg@ethernet-dhcp.service: main process exited, code=exited, status=1/FAILURE
Jan 30 16:28:27 hostname systemd[1]: Failed to start Netcfg networking service for profile ethernet-dhcp.
Jan 30 16:28:27 hostname systemd[1]: Unit netcfg@ethernet-dhcp.service entered failed state

The problem is that interface enp4s0 (my Ethernet interface) apparently doesn't exist, but it seems to exist immediately afterwards because as soon as I login, I can use 'netcfg ethernet-dhcp' to get the profile running fine.

Is systemd sometimes starting this service before enp4s0 is 'registered'? Is this preventable?

Also, here's my netcfg profile (it's just based on /etc/network.d/examples/ethernet-dhcp):

CONNECTION='ethernet'
DESCRIPTION='A basic dhcp ethernet connection using iproute'
INTERFACE='enp4s0'
IP='dhcp'
DHCLIENT=yes

Thanks in advance.

Offline

#2 2013-01-30 18:51:32

chris_l
Member
Registered: 2010-12-01
Posts: 387

Re: Netcfg profile sometimes fails to start on boot

Probably related with this bug: https://bugs.archlinux.org/task/33608

Try to use dhcpcd@enp4s0.service instead

Last edited by chris_l (2013-01-30 18:51:50)


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2013-01-30 19:56:37

Archimaredes
Member
Registered: 2013-01-23
Posts: 50

Re: Netcfg profile sometimes fails to start on boot

chris_l wrote:

Probably related with this bug: https://bugs.archlinux.org/task/33608

Try to use dhcpcd@enp4s0.service instead

Hmm. Enabling that instead means I don't get a connection on boot at all.

Offline

#4 2013-02-01 21:21:32

Archimaredes
Member
Registered: 2013-01-23
Posts: 50

Re: Netcfg profile sometimes fails to start on boot

I hate to bump threads, but anybody got any ideas? I looked at the threads that bug page linked to, and installed netctl from the AUR (it's meant to sort out these race conditions at boot), but it doesn't read my profile configuration files properly apparently, and it's meant to, so I went back to netcfg for the time being.

That bug is a recent report, so I guess something may be done about it in the future.

Last edited by Archimaredes (2013-02-01 21:22:16)

Offline

#5 2013-02-01 21:27:38

cris9288
Member
Registered: 2013-01-07
Posts: 347

Re: Netcfg profile sometimes fails to start on boot

did you make sure to disable netcfg@ethernet-dhcp.service? Seems obvious, but sometimes I forget to stop a service. systemctl enable/start dhcpcd@enp4s0.service should just work without any effort on your part.

Offline

#6 2013-02-01 23:10:01

Archimaredes
Member
Registered: 2013-01-23
Posts: 50

Re: Netcfg profile sometimes fails to start on boot

cris9288 wrote:

did you make sure to disable netcfg@ethernet-dhcp.service? Seems obvious, but sometimes I forget to stop a service. systemctl enable/start dhcpcd@enp4s0.service should just work without any effort on your part.

Okay, I'll try that. Thanks.

Offline

#7 2013-02-02 15:18:24

jouke
Member
Registered: 2009-10-14
Posts: 63

Re: Netcfg profile sometimes fails to start on boot

Be sure to update your variable names when you switch to netctl. Refer to `man netctl.profile` for details. At some point there will be a detailed overview of the transition process, for now this will have to do:

Transition should not be hard. At any rate the three new man pages netctl(1), netctl.profile(5), and netctl.special(7) should answer all questions. Here is a basic outline of the changes required:

  • Rename variables in the profiles in /etc/network.d/ and unquote some of their values (mainly Interface=).

  • Run netctl enable <profile> for every profile in the old NETWORKS array. 'last' doesn't work this way, see netcfg.special(7).

  • Use netctl list / netctl start <profile> instead of netcfg-menu, wifi-menu remains available.

Offline

#8 2013-02-04 15:11:06

mcloaked
Member
From: Yorkshire, UK
Registered: 2012-02-02
Posts: 719

Re: Netcfg profile sometimes fails to start on boot

Archimaredes wrote:
chris_l wrote:

Probably related with this bug: https://bugs.archlinux.org/task/33608

Try to use dhcpcd@enp4s0.service instead

Hmm. Enabling that instead means I don't get a connection on boot at all.

If it is any help the way I have things working on two different machines for wired connection at boot is to do the following:

1) pacman -S ifplugd netcfg
2) Do as root

 # ip link 

and check the name of your network interface - in my case one machine had enp0s25 and in another it was eno1
2) In /etc/network.d/ copy one of the profiles from the samples directory into the /etc/network.d/ directory and edit the file for your situation (in my case ethernet-static)
3) In /etc/ifplugd/ifplugd.conf make sure that the network interface name is correct.
4) In /etc/conf.d/netcfg make sure that the network name is correct and the network profile that you want is specifically named - eg in mine that section is:

# Network profiles are found in /etc/network.d
#NETWORKS=(last)
NETWORKS=(ethernet-static)

# Specify the name of your wired interface for net-auto-wired
WIRED_INTERFACE="eno1"

5) Do not enable netcfg.service with systemctl but make sure you have:

systemctl enable net-auto-wired

Now reboot and your wired network should be alive by the time the system has booted.

I found that if you enable netcfg.service it won't work - so it should not be running but net-auto-wired.service should be running.

Hope this helps.


Mike C

Offline

Board footer

Powered by FluxBB