Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 622730 - net-misc/netifrc-0.5.1 and 0.7.1 tells me "need dbus"
Summary: net-misc/netifrc-0.5.1 and 0.7.1 tells me "need dbus"
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: netifrc Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-26 10:06 UTC by Gerold Schellstede
Modified: 2021-07-11 07:53 UTC (History)
3 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 Gerold Schellstede 2017-06-26 10:06:00 UTC
Hello,

since I have installed netifrc 0.5.1 it tells me "need dbus" at starting the loopback. Until now this does not result in "real usage errors". It looks like the following:

*INIT: Entering runlevel: 3
.
.
.
*starting dbus
*starting consolekit
.
.
.
*Bridging up interface lo
*   Caching network module dependencies 
need dbus
*   127.0.0.1/8
*   Adding routes 
*   127.0.0.0/8 via 127.0.0.1
.
.
.

If I delete the loopback from runlevel default the first network-card which starts produces the "need dbus" error. 

The problem was also mentioned in the gentooforum: 
https://forums.gentoo.org/viewtopic-t-1056118.html?sid=612a4fb8b25b7d0ef5eb6e9c71679d83

Best regards
Comment 1 Ben Kohler gentoo-dev 2019-07-10 14:47:51 UTC
Can you still reproduce this on netifrc-0.6.1?
Comment 2 Gerold Schellstede 2019-07-17 17:01:48 UTC
Thanks for your answer,

unfortunately I can still reproduce it.
Comment 3 Gerold Schellstede 2020-03-20 14:28:20 UTC
Unfortunately the error is still present, but is has changed a little bit.  

In netifrc-0.5.1 only the first network device starting -- normally lo -- produced the error.

In netifrc-0.7.1 all network devices starting produce the error. 

Best Regards
Comment 4 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-14 23:44:55 UTC
The error seems to originate from wpa_supplicat.sh provided by netifrc, with XTRACE one can see

+ eval wpa_supplicant_depend
++ wpa_supplicant_depend
++ wpas=/usr/sbin/wpa_supplicant
++ '[' -x /usr/sbin/wpa_supplicant ']'
++ '[' -x /usr/sbin/wpa_supplicant ']'
++ program start /usr/sbin/wpa_supplicant
++ '[' start = start ']'
++ local s=start
++ shift
++ eval 'wpa_supplicant_program_start="${wpa_supplicant_program_start}${wpa_supplicant_program_start:+ }/usr/sbin/wpa_supplicant"'
+++ wpa_supplicant_program_start=/usr/sbin/wpa_supplicant
++ /usr/sbin/wpa_supplicant -h
++ grep DBus -sq
++ '[' 0 -eq 0 ']'
++ need dbus
++ '[' -n dbus ']'
++ echo 'need dbus'
need dbus


This is output of running

wpa_supplicant_depend()
{
    wpas=/usr/sbin/wpa_supplicant
    [ -x ${wpas} ] || wpas=/sbin/wpa_supplicant
    if [ -x ${wpas} ]; then
        program start ${wpas}
        # bug 345281: if wpa_supplicant is built w/ USE=dbus, we need to start
        # dbus before we can start wpa_supplicant.
        ${wpas} -h |grep DBus -sq
        [ $? -eq 0 ] && need dbus
    fi
    after macnet plug
    before interface
    provide wireless

    # Prefer us over iwconfig
    after iwconfig
}

For whatever reason, the functions like after, before and provided seems to execute other function that the need that is defined in /lib/rc/sh/openrc-run.sh as 

need() {
    [ -n "$*" ] && echo "need $*"
}

Steps to reproduce;
- enable rc.log
- add 'set -x' to /etc/init.d/net.lo
- reboot
- see /var/log/rc.log
Comment 5 Piotr Karbowski (RETIRED) gentoo-dev 2021-01-14 23:58:25 UTC
After looking more into it, it seems the problem is that the function 'need' does not work, or does not interfaces with openrc-run. Instead of being passed to openrc, it prints to screen.
Comment 6 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2021-01-18 14:19:43 UTC
(In reply to Piotr Karbowski from comment #5)
> After looking more into it, it seems the problem is that the function 'need'
> does not work, or does not interfaces with openrc-run. Instead of being
> passed to openrc, it prints to screen.


Well, it gets caught by the need() function of openrc's /lib/rc/sh/openrc-run.sh helper which does a simple echon on every input to that function:

# grep -FA2 'need()' /lib/rc/sh/openrc-run.sh
need() {
        [ -n "$*" ] && echo "need $*"
}


This has worked back when netifrc was part of openrc. But nowadays it's simply dead code and should be removed.

Thanks Piotr for your thorough analysis and your patience with me ;)
Comment 7 Larry the Git Cow gentoo-dev 2021-01-18 14:40:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/netifrc.git/commit/?id=60bd853443f8e01c4309aeb2f3198f959c62cfdf

commit 60bd853443f8e01c4309aeb2f3198f959c62cfdf
Author:     Lars Wendler <polynomial-c@gentoo.org>
AuthorDate: 2021-01-18 14:21:31 +0000
Commit:     Lars Wendler <polynomial-c@gentoo.org>
CommitDate: 2021-01-18 14:26:11 +0000

    net/wpa_supplicant.sh: Removed non-working "need dbus" call
    
    This is a remnant from when netifrc was part of openrc.
    After netifrc became it's own standalone project, the call "need dbus"
    got caught by the need() function from openrc's sh/openrc-run.sh script
    which does a simple echo on every input it receives.
    
    Bug: https://bugs.gentoo.org/622730
    Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>

 net/wpa_supplicant.sh | 8 --------
 1 file changed, 8 deletions(-)
Comment 8 kfm 2021-07-11 07:53:48 UTC
Closing, as the above mentioned patch was incorporated by netifrc-0.7.3.