Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 554510 - net-misc/netifrc: Process 'net.sh <NIC> start' failed with exit code 1.
Summary: net-misc/netifrc: Process 'net.sh <NIC> start' failed with exit code 1.
Status: RESOLVED DUPLICATE of bug 575128
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard: netifrc:udev
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-11 13:15 UTC by Thomas Deutschmann (RETIRED)
Modified: 2016-10-24 22:54 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2015-07-11 13:15:17 UTC
Hi,

with sys-fs/udev-222 I notice the following messages in `dmesg` after boot:

> [    2.491212] vmxnet3 0000:03:00.0 lan0: renamed from eth1
> [    2.491781] input: PC Speaker as /devices/platform/pcspkr/input/input4
> [    2.494727] input: ImPS/2 Generic Wheel Mouse as /devices/platform/i8042/serio1/input/input5
> [    2.502750] udevd[2389]: Process 'net.sh eth0 start' failed with exit code 1.
> [    2.505802] udevd[2385]: Process 'net.sh eth1 start' failed with exit code 1.

I haven't seen this with sys-fs/udev-220-r3 so I run bisect and found the following "bad commit":

> e013d21b6218011c99dbbcd4c61fc73a24490a94 is the first bad commit
> commit e013d21b6218011c99dbbcd4c61fc73a24490a94
> Author: Filipe Brandenburger <filbranden@google.com>
> Date:   Wed Jun 3 07:31:12 2015 -0700
> 
>     build-sys: Work around --with-rootprefix= (empty) not producing /
> 
>     Since we introduced AX_NORMALIZE_PATH, using --with-rootprefix=/ does
>     produce an empty string, but using --with-rootprefix= (empty) now
>     produces "." instead which is wrong.
> 
>     Work around it until we can find a better solution for AX_NORMALIZE_PATH
>     upstream at autoconf-archive.
> 
>     Bug: https://github.com/systemd/systemd/issues/54

https://github.com/systemd/systemd/commit/e013d21b6218011c99dbbcd4c61fc73a24490a94


When I revert this commit I don't see the quoted message anymore in sys-fs/udev-222.


net.sh will be called from "/lib/udev/rules.d/90-network.rules". I have the feeling that this rule didn't work in the last udev versions in Gentoo. Now, due to the commit, this rule will be called again and uncovers a different problem.

Things to note:

 - My system has 2 NICs
 
 - I am renaming one of my NICs via
 
   $ cat /etc/udev/rules.d/80-net-setup-link.rules
   SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="00:0c:29:45:a5:fd", NAME="lan0"


 - Please notice that udeved renamed the NIC at 2.491212 but tries to to
   start net.sh using the *old* name (eth1 at 2.505802). That sounds like
   a bug in udev. Not?


Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2015-07-11 17:10:39 UTC
I think this is a bug in the netifrc udev rule.

# Activate our network if we can
SUBSYSTEM=="net", ACTION=="add",    RUN+="net.sh %k start"
SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop"

From the udev manual:

       The NAME, SYMLINK, PROGRAM, OWNER, GROUP, MODE, and RUN fields support
       simple string substitutions. The RUN substitutions are performed after
       all rules have been processed, right before the program is executed,
       allowing for the use of device properties set by earlier matching
       rules. For all other fields, substitutions are performed while the
       individual rule is being processed. The available substitutions are:

       $kernel, %k
           The kernel name for this device.

       $name
           The current name of the device. If not changed by a rule, it is the
           name of the kernel device.

Does the udev rule work if you change %k to $name?
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2015-07-11 18:23:03 UTC
When I change %k to $name udev will use the correct names, yes.
But net.sh is still failing:

> [    2.358796] udevd[2326]: starting version 222
> [    2.552920] vmxnet3 0000:03:00.0 lan0: renamed from eth1
> [    2.557910] udevd[2455]: Process 'net.sh eth0 start' failed with exit code 1.
> [    2.562306] input: PC Speaker as /devices/platform/pcspkr/input/input4
> [    2.567088] input: ImPS/2 Generic Wheel Mouse as /devices/platform/i8042/serio1/input/input5
> [    2.568554] udevd[2457]: Process 'net.sh lan0 start' failed with exit code 1.


And it is "/etc/init.d/net.eth0" and "/etc/init.d/net.lan0" which is failing with exit code 1:

> * net.eth0: not allowed to be hotplugged
> * net.lan0: not allowed to be hotplugged
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2015-07-11 19:47:42 UTC
As expected, when I set 'rc_hotplug="*"' in "/etc/rc.conf" the error goes away but I don't want to enable hotplug for my built-in network cards (especially because this would start net.eth0 which I haven't enabled in my runlevels).

Seems like net.sh is missing a check if hotplug is enabled or not for the interface.

I tried to use the service_hotplugged applet but I don't know how to get it working. This is how openrc-run checks if hotplugging is allowed: https://github.com/OpenRC/openrc/blob/master/src/rc/openrc-run.c#L1027-L1057
Comment 4 Mike Gilbert gentoo-dev 2015-07-12 20:28:00 UTC
Updating summary and copying openrc.
Comment 5 Ian Stakenvicius (RETIRED) gentoo-dev 2015-07-12 20:43:45 UTC
What is your rc_hotplug set to normally?  an rc_hotplug="* !net.eth*" should work to exclude your eth0 etc while letting net.lan0 launch.
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2015-07-12 20:45:09 UTC
Default value, rc_hotplug is not set.
Comment 7 Ian Stakenvicius (RETIRED) gentoo-dev 2015-07-13 20:40:32 UTC
So is the issue here -just- the failure message in dmesg??  because if it's acting the way it should, which is to not start the init script during hotplug, and the exit code 1 isn't causing anything else to fail, then it looks to me like everything is fine.
Comment 8 Thomas Deutschmann (RETIRED) gentoo-dev 2015-07-15 00:16:33 UTC
Yes, you are right: Currently it is just a failure message from udev. No "real" problem (at least I haven't seen any problems due to these messages).
Comment 9 Martin Mokrejš 2015-08-29 15:08:10 UTC
A similar issue at https://github.com/systemd/systemd/issues/1070 but it does matter for me. I have to startup the USB dongle modem via /etc/init.d/net.ppp0 which uses the /dev/ttyUSB0 interface. It does not receive DHCP answer via wwp0s29u1u2i1 interface (originally wwan0).

# emerge --info
Portage 2.2.18 (python 2.7.9-final-0, default/linux/amd64/13.0, gcc-4.9.3, glibc-2.21-r1, 4.1.6-default-pciehp x86_64)
=================================================================
System uname: Linux-4.1.6-default-pciehp-x86_64-Intel-R-_Core-TM-_i7-2640M_CPU_@_2.80GHz-with-gentoo-2.2
KiB Mem:    16361268 total,  14947272 free
KiB Swap:   16776188 total,  16776188 free
Timestamp of repository gentoo: Mon, 24 Aug 2015 13:00:01 +0000
sh bash 4.3_p42
ld GNU ld (Gentoo 2.25.1 p1.0) 2.25.1
app-shells/bash:          4.3_p42::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r2::gentoo, 3.2.5-r6::gentoo, 3.4.3::gentoo
dev-util/cmake:           3.2.1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r1::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.12.6::gentoo, 1.13.4::gentoo, 1.14::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1::gentoo
sys-devel/gcc:            4.3.6-r1::gentoo, 4.4.7::gentoo, 4.6.4::gentoo, 4.7.4::gentoo, 4.8.4::gentoo, 4.9.3::gentoo
sys-devel/gcc-config:     1.8::gentoo
sys-devel/libtool:        2.4.6-r1::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.0::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

...

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1 sun-bcla-java-vm Oracle-BCLA-JavaSE IBM-J1.6 skype-eula Nero-EULA-US AdobeFlash-10.3 skype-4.0.0.7-copyright AdobeFlash-11.x"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.2/conf /var/bind /var/lib/hsqldb /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/apache2-php5.6/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -maes -mpclmul -mpopcnt -mavx -march=native"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="rsync://ftp.fi.muni.cz/pub/linux/gentoo/ rsync://gentoo.mirror.dkm.cz/gentoo/ ftp://gentoo.mirror.web4u.cz/"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X acpi alsa amd64 amr apache apache2 apulse avx berkdb bindist bluetooth boost bzip2 cairo cgi cli coin consolekit cracklib crypt cryptlib cups cxx dbus device-mapper dhcp directfb dri drm dvd emboss encode fax fbcon ffmpeg flac fontconfig fortran gbm gd gdbm geoip gimp glpk gnutls gpm gtk hal hpijs hwdb iconv id3tag imaging innodb java jce jpeg jpg keymap ladspa lapack laptop lcms libnotify lm_sensors mad matroska mmx mmxext modules mpi mpich2 multilib mysql ncurses nfs nls nptl nptlonly nscd nsplugin ntfsprogs ocr ogg opengl openmp pam parport pcre pdf perl php png policykit polkit ppds pppd python qt3support readline rendering resolvconf scanner seccomp server session slideshow sndfile sqlite sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 suexec svg syslog tcl tcpd threads tiff tk truetype udev unicode usb v4l v4l2 vim-syntax vnc wavpack wifi x11 xcb xml xorg xrandr xv xvid xvmc zlib" ABI_X86="64 32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="alias authz_host auth_basic auth_digest cgi cgid deflate dir env filter include info mem_cache mime mime_magic negotiation remoteip setenvif status userdir vhost_alias rewrite usertrack cache file_cache disk_cache charset_lite log_config log_forensic" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_US en_GB cs cz" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4 php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="vesa vmware fbdev intel i915 i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS


I have net-misc/netifrc-0.3.1 and sys-fs/udev-224-r2 installed.
Comment 10 Erik Quaeghebeur 2016-04-13 20:45:06 UTC
I can confirm this (seemingly harmless) warning (log level 4) message:

> journalctl -b -q -p 4..4 | grep net.sh
apr 13 22:28:30 <hostname> systemd-udevd[155]: Process 'net.sh wlan0 start' failed with exit code 1.
apr 13 22:28:30 <hostname> systemd-udevd[140]: Process 'net.sh eth0 start' failed with exit code 1.
Comment 11 Matt Whitlock 2016-04-14 01:59:29 UTC
Apr 08 00:14:03 [kernel] systemd-udevd[551]: starting version 229
Apr 08 00:14:03 [kernel] e1000e 0000:03:00.0 enp3s0: renamed from eth0
Apr 08 00:14:03 [kernel] systemd-udevd[633]: Process 'net.sh eth0 start' failed with exit code 1.

Apparently the only reason my networking is still working at all is that some runlevel-enabled service is auto-starting the "dhcpcd" service (presumably because it needs "net", and "net.lo" no longer provides "net"). My "net.enp3s0" service is actually stopped, though the interface is up and bound (presumably by "dhcpcd"). So hotplugging of "predictably named" network interfaces appears broken.
Comment 12 Maciej S. Szmigiero 2016-10-09 17:47:01 UTC
(In reply to Mike Gilbert from comment #1)
> I think this is a bug in the netifrc udev rule.
> 
> # Activate our network if we can
> SUBSYSTEM=="net", ACTION=="add",    RUN+="net.sh %k start"
> SUBSYSTEM=="net", ACTION=="remove", RUN+="net.sh %k stop"
> 
> From the udev manual:
> 
>        The NAME, SYMLINK, PROGRAM, OWNER, GROUP, MODE, and RUN fields support
>        simple string substitutions. The RUN substitutions are performed after
>        all rules have been processed, right before the program is executed,
>        allowing for the use of device properties set by earlier matching
>        rules. For all other fields, substitutions are performed while the
>        individual rule is being processed. The available substitutions are:
> 
>        $kernel, %k
>            The kernel name for this device.
> 
>        $name
>            The current name of the device. If not changed by a rule, it is
> the
>            name of the kernel device.
> 
> Does the udev rule work if you change %k to $name?

I hit this bug (that net.x service hotplugging does not work with renamed
interface).
Changing "%k" to "$name" in /lib/udev/rules.d/90-network.rules fixed this.
Will this issue be tracked in this bug report or should new one be created?
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2016-10-24 22:54:08 UTC

*** This bug has been marked as a duplicate of bug 575128 ***