You are not logged in.
Pages: 1
I am using Arch linux with systemd.
All packages are recent.
And I encountered the following behavour when configuring network:
netcfg.service starts before network interfaces appear in the system (modules are not yet loaded), so I get the following error in syslog:
netcfg-daemon[463]: :: mgmt up Interface eth0 does not exist
netcfg-daemon[463]: [fail]
So I added the following line to "Unit" to /etc/systemd/system/multi-user.target.wants/netcfg.service:
[Unit]
After=sys-class-net-eth0.device
But it didn't help - the netcfg-daemon still starts before the symlink /sys/calss/net/eth0 appears.
Please advise - what can be done to fix the problem with network configuration?
Offline
systemctl enable net-auto-wired.service ?
Last edited by Perfect Gentleman (2012-10-29 08:07:03)
Offline
Its a bug and is currently being looked at https://mailman.archlinux.org/pipermail … 03331.html
Offline
No, they were not present.
I enabled net-auto-wired.service and the eth0 interface configured correctly.
Although the question remains - can't I use only netcfg.service for network configuration?
Last edited by igvk (2012-10-29 08:53:56)
Offline
O.K. It's a bug.
So - I need to enable net-auto-wired.service and disable netcfg.service, right?
Is this the correct way to configure network?
Offline
intall ifplugd, and enable net-auto-wired.service and disable netcfg.service. i think net would be work
Offline
The problem with net-auto-wired is that it configures only interface eth0 (defined by WIRED_INTERFACE in /etc/conf.d/netcfg).
What about all the other interfaces (defined by NETWORKS)?
Offline
when i used netcfg with wlan. i configured file in /etc/network.d/, the enabled net-auto-wireless.service, and not enabled netcfg.service. really i don't know whether it was enabled or not.
Offline
As a temporary workaround, try
sudo systemctl restart netcfg
Offline
Does anyone have a stable working solution for confiuring multiple interfaces via systemd on startup?
Offline
Its a bug and is currently being looked at https://mailman.archlinux.org/pipermail … 03331.html
Rather look at this patch series: https://mailman.archlinux.org/pipermail … 03350.html. This is far from finished: There's conflict handling remaining, and the netcfg, wifi-menu and netcfg-menu commands should forward everything to systemd instead of starting the profiles inside the current session.
Offline
Does anyone have a stable working solution for confiuring multiple interfaces via systemd on startup?
I have both wired and wireless running no problem.
I've enabled both net-auto-wired and net-auto-wireless in systemd.
I have ifplugd installed and wireless starts and stops as I plug/unplug my laptop from the docking station (or at least last time I tried).
I also am able to have both up and running at the same time, though they run separately and unfortunately the upload and doownload are the wrong way round, one day I may try and set up bonding again (though that's a different issue).
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
I am looking forward to integration of the patches into archlinux.
And - several eth (eth1, eth2, eth3, etc.) interfaces won't come up when using net-auto-wired - only eth0.
Last edited by igvk (2012-10-29 10:33:19)
Offline
I am looking forward to integration of the patches into archlinux.
And - several eth (eth1, eth2, eth3, etc.) interfaces won't come up when using net-auto-wired - only eth0.
Sorry, didn't realise you were talking about multiple eth interfaces, thought you were talking about eth & wlan. I guess my post is irrelevant.
"...one cannot be angry when one looks at a penguin." - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle
Offline
I am looking forward to integration of the patches into archlinux.
You could get the patches from my github and build a netcfg package with them: https://github.com/brain0/netcfg/commits/working. Everything should be fine as long as you configure auto-started profiles in /etc/conf.d/netcfg and only manually start and stop profiles using
systemctl netcfg-profile-NAME.service
instead of the native netcfg command. If you change a profile, run
systemctl --system daemon-reload
before trying to start a profile.
Offline
Another suggestion is to put a timeout in netcfg when it's checking the existence of the interface (ex. 'eth0'). Netcfg already does that while waiting for the LINK UP and CARRIER flags right after doing a 'ip link set dev "$INTERFACE" up'.
In the /usr/lib/network/connections/ethernet script of netcfg, it assumes $INTERFACE (ex. 'eth0') is already existing, or else it will fail. I commented the code below #### where the updated code should be placed. There's an example timeout_wait() near the bottom when it waits for 5 secs for the CARRIER signal.
/usr/lib/network/connections/ethernet (part of netcfg).
----------------------------------------------------------
.
ethernet_up() {
load_profile "$1"
SYSCTL_INTERFACE="${INTERFACE/.//}"
#### As implemented now is_interface() exits on error when /sys/class/net/$INTERFACE doesn't exist yet.
#### Insert a timeout_wait here (30 sec max?) so netcfg can wait for /sys/class/net/eth0 to show up before failing:
if ! is_interface "$INTERFACE"; then
report_iproute "Interface $INTERFACE does not exist"
fi
# Disable IPv6 before bringing the interface up to prevent SLAAC
if [[ "$IP6" == "no" ]]; then
sysctl -q -w "net.ipv6.conf.$SYSCTL_INTERFACE.disable_ipv6=1"
fi
report_debug ethernet_up bring_interface up "$INTERFACE"
bring_interface up "$INTERFACE"
if ! checkyesno "${SKIPNOCARRIER:-no}"; then
# Some cards are plain slow to come up. Don't fail immediately.
if ! timeout_wait "${CARRIER_TIMEOUT:-5}" '(( $(< "/sys/class/net/$INTERFACE/carrier") ))'; then
report_iproute "No connection"
fi
fi
.
The is_interface() funtions is in /usr/lib/network/network (also part of netcfg).
/usr/lib/network/network (part of netcfg).
----------------------------------------------------------
is_interface() {
local INTERFACE="$1"
if [[ ! -e "/sys/class/net/$INTERFACE" ]]; then
if ! echo "$INTERFACE" | grep -F -q ":"; then
return 1
fi
fi
return 0
}
The timeout_wait() function is in /usr/lib/network/globals (also part of netcfg).
/usr/lib/network/globals (part of netcfg).
----------------------------------------------------------
## Waits until a statement succeeds or a timeout occurs
# $1: timeout in seconds
# $2...: condition command
function timeout_wait() {
local timeout="$1"
(( timeout *= 10 ))
shift
while ! eval "$*"; do
(( timeout-- > 0 )) || return 1
sleep 0.1
done
return 0
}
This would be a viable solution until the systemd device dependencies are worked out. I'm not a confident bash coder so I leave others to work this out. Probably takes 2 min for the experienced ones.
Offline
Ok, finally figured out what the patch was for. Got the service file to work. Netcfg now loads only after eth0 is available:
/etc/systemd/system/netcfg.service
----------------------------------------------------
[Unit]
Description=Netcfg multi-profile daemon
Before=network.target
Wants=network.target
BindsTo=sys-subsystem-net-devices-eth0.device
After=sys-subsystem-net-devices-eth0.device
.
.
I now realize why brain0 is reconsidering Netcfg. The way the profiles are stuctured isn't friendly to systemd unit files without using a separate service file generator (netcfg-generator). For computers with just a static interface (eth0), it's not a problem though.
Thanks for the patch brain0.
Offline
Ok, finally figured out what the patch was for. Got the service file to work. Netcfg now loads only after eth0 is available:
/etc/systemd/system/netcfg.service ---------------------------------------------------- [Unit] Description=Netcfg multi-profile daemon Before=network.target Wants=network.target BindsTo=sys-subsystem-net-devices-eth0.device After=sys-subsystem-net-devices-eth0.device . .
The part:
After=sys-subsystem-net-devices-eth0.device
doesn't work for me - netcfg starts before the interfaces are available.
Offline
The part:
After=sys-subsystem-net-devices-eth0.device
doesn't work for me - netcfg starts before the interfaces are available.
The BindsTo= is needed too, or else it won't work.
Also make sure that the new service file is under /etc/systemd/system/, NOT /etc/systemd/system/multi-user.target.wants/. I made the same mistake before of changing the symlinks into actual files under ../multi-user.target.wants/. I was wondering why the behavior didn't change no matter what I did to the file.
The files under ../multi-user.target.wants/ need to remain as symlinks. Then run systemctl reenable netcfg, systemd will change the netcfg symlink under multi-user.target.wants/ to point to the new /etc/systemd/system/netcfg.service.
Check out https://wiki.archlinux.org/index.php/Sy … unit_files.
Offline
Also make sure that the new service file is under /etc/systemd/system/, NOT /etc/systemd/system/multi-user.target.wants/. I made the same mistake before of changing the symlinks into actual files under ../multi-user.target.wants/. I was wondering why the behavior didn't change no matter what I did to the file.
The files under ../multi-user.target.wants/ need to remain as symlinks. Then run systemctl reenable netcfg, systemd will change the netcfg symlink under multi-user.target.wants/ to point to the new /etc/systemd/system/netcfg.service.
Check out https://wiki.archlinux.org/index.php/Sy … unit_files.
Thank you very much!
This is what helped after all. I made the same mistake of not placing the file into /etc/systemd/system.
Offline
May tag on a question that was briefly touched on earlier in this thread? If I have net-auto-wired and net-auto-wireless enabled, do I need to disable the netcfg service or is it required for the first two to operate properly? When I check netcfg status it showed that failed, but my wireless connects automatically, so reading this thread makes me wonder if I need to change a couple things.
Thanks!
Czar.
Laptop: Lenovo X1 Carbon, Core i7 2.0Ghz, 8GB RAM, Gnome 3.16
Offline
The description says "Netcfg multi-profile daemon". It's not needed by either net-auto-wired or net-auto-wireless, serves a different purpose entirely.
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
Thanks, ngoonee. I...probably should've checked the description first.
Cheers,
Czar.
Laptop: Lenovo X1 Carbon, Core i7 2.0Ghz, 8GB RAM, Gnome 3.16
Offline
Yeah well, we do miss things once in a while. Please mark [solved]
Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.
Offline
I would if I could, igvk is the owner of this thread.
Laptop: Lenovo X1 Carbon, Core i7 2.0Ghz, 8GB RAM, Gnome 3.16
Offline
Pages: 1