Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 73627

Summary: /etc/conf.d/net should document the existence of the [pre|post]up() and [pre|post]down() functions
Product: Gentoo Linux Reporter: Andy Dalton <andy.dalton>
Component: [OLD] baselayoutAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Andy Dalton 2004-12-06 23:21:43 UTC
/etc/conf.d/net can include functions named preup() and predown() that are executed before a network interface is brought up or down respectively; and postup() and postdown() that are executed after a network interface is brought up or down respectively.  This functionality is *very* useful to people that want to try to check the link status on their network card prior to trying to bring the interface up (e.g. laptop users).  The problem is, no one knows about them!  I have been unable to find any mention of them in any documentation.  The only way I know about them is from http://bugs.gentoo.org/show_bug.cgi?id=33272
There is also some mention of them in the forums.

I suggest adding some documentation to /etc/conf.d/net indicating that these four functions can be defined and why someone might want to define them.  This documentation could be in the form of sample implementations of the functions like what follows.

My currently installed version of baselayout is: 1.9.4-r6

Thank you for your consideration in this matter.

Andy

#
# preup
#
# Executed prior to bringing up a network interface.
# This function can be used to test for link activity
# on an interface.  If this function returns 0, the
# interface will be brought up; otherwise, the interface
# will remain down.
#
# Parameters: $1 The name of the interface (e.g. eth0)
#
#preup() {
#    if [[ $1 == eth0 ]]; then
#        ethtool | grep -q 'Link detected: yes'
#        return $?
#    fi
#    return 0
#}

#
# predown
#
# Executed prior to bringing down a network interface.
# If this function returns 0, the interface will be
# brought down; otherwise the interface will remain up.
#
# Parameters: $1 The name of the interface (e.g. eth0)
#
#predown() {
#}

#
# postup
#
# Executed after bringing up a network interface.
#
# Parameters: $1 The name of the interface (e.g. eth0)
#
#postup() {
#}

#
# postdown
#
# Executed after bringing down a network interface.
#
# Parameters: $1 The name of the interface (e.g. eth0)
#
#postdown() {
#}
Comment 1 SpanKY gentoo-dev 2004-12-07 06:44:32 UTC
use baselayout-1.11.x
Comment 2 Andy Dalton 2004-12-07 08:59:31 UTC
Shouldn't that be "RESOLVED FIXED" instead of "RESOLVED WONTFIX" since it is fixed?

At any rate, the new config looks great!  Thanks!

Andy
Comment 3 SpanKY gentoo-dev 2004-12-07 11:03:22 UTC
i marked it 'WONTFIX' because we're not going to be fixing the 1.9.x baselayout ;)