Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 402267 - sys-apps/openrc replaces custom net.* scripts regardless of CFGPROTECT
Summary: sys-apps/openrc replaces custom net.* scripts regardless of CFGPROTECT
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: OpenRC (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: OpenRC Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-05 16:54 UTC by Juraj Variny
Modified: 2013-04-26 16:37 UTC (History)
1 user (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 Juraj Variny 2012-02-05 16:54:40 UTC
I am using custom /etc/init.d/net.wlan0 script. Emerging any recent version of openrc (at least 0.9.8.4) silently moves it into /etc/init.d/net.wlan0.openrc.bak and install symlink to net.lo instead.


Reproducible: Always

Steps to Reproduce:
1. Create custom /etc/init.d/net.* script instead of symlink no net.lo
2. (Re)emerge openrc
Actual Results:  
Your initscript is now replaced regardless of CFGPROTECT settings. On next reboot the new net.* script can fail ( with "interface not initialized" error) and not even sshd is subsequently started, despite other interfaces start OK.

Expected Results:  
OpenRC should honor CFGPROTECT configuration and never update such files.

Or, it should be clearly documented that custom net.* scripts are not supported and should never be used.
Comment 1 Ben Kohler gentoo-dev 2012-02-05 17:14:18 UTC
I wouldn't say it *silently* moves it.  The block of code responsible for this does clearly put a message in elog.  I know this isn't *great* but the symlink fixing here probably helps many many more people than it hurts.  Unfortunately it's helping new users who did the *wrong* thing, and hurting those who know what they're doing.

...
    # force net init.d scripts into symlinks
    for f in "${ROOT}"/etc/init.d/net.* ; do
        [[ -e ${f} ]] || continue # catch net.* not matching anything
        [[ ${f} == */net.lo ]] && continue # real file now
        [[ ${f} == *.openrc.bak ]] && continue
        if [[ ! -L ${f} ]] ; then
            elog "Moved net service '${f##*/}' to '${f##*/}.openrc.bak' to force a symlink."
            elog "You should delete '${f##*/}.openrc.bak' if you don't need it."
            mv "${f}" "${f}.openrc.bak"
            ln -snf net.lo "${f}"
        fi
    done
...
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-02-05 20:35:02 UTC
What do you have in that net.wlan0 then?
Comment 3 Juraj Variny 2012-02-05 23:04:04 UTC
It's just standard ifconfig/iwconfig/iwpriv stuff. I don't see any reason to spend time to convert it into network configuration format of the day, and debug it.

I was thinking that with 

emerge -uDNavt --quiet-build world 

I get the messages. This is true no more?
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2012-02-05 23:06:46 UTC
If that's all you need, name it something OTHER than net.*, and just have it 'provide net'
Comment 5 Juraj Variny 2012-02-05 23:10:41 UTC
After some study, seems I have to set 

PORTAGE_ELOG_SYSTEM="echo"

in make.conf. Weird.

(In reply to comment #3)
> I was thinking that with 
> 
> emerge -uDNavt --quiet-build world 
> 
> I get the messages. This is true no more?
Comment 6 Juraj Variny 2012-02-05 23:12:44 UTC
(In reply to comment #4)
> If that's all you need, name it something OTHER than net.*, and just have it
> 'provide net'

Are you sure it won't create its own new.wlan0 link when device gets detected, and then bomb out when it can't initialize it properly?
Comment 7 Ben Kohler gentoo-dev 2012-02-06 04:49:06 UTC
No, it will not do that
Comment 8 William Hubbs gentoo-dev 2012-02-17 18:06:58 UTC
You were given a solution for this in comment #4. There has been no
activity in over a week on this bug, so I am closing it. Please re-open
if there is still an issue.

Thanks,

William
Comment 9 William Hubbs gentoo-dev 2013-04-26 16:37:02 UTC
The code that did this was part of the migration from baselayout-1.x to
OpenRC, and has now been removed from the ebuild. This will no longer be
an issue when OpenRC-0.12 is released.