Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38210 - net.eth?: Add hook to run script before ifconfig (for wireless, etc.)
Summary: net.eth?: Add hook to run script before ifconfig (for wireless, etc.)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: Inclusion
Depends on:
Blocks:
 
Reported: 2004-01-14 13:33 UTC by Luke Maurer (Jyrinx)
Modified: 2004-07-23 02:02 UTC (History)
1 user (show)

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


Attachments
Modified net.eth0 to run script before ifconfig step (net.eth0.diff,979 bytes, patch)
2004-01-14 13:34 UTC, Luke Maurer (Jyrinx)
Details | Diff
New /etc/conf.d/net with comments on new preifup option (conf.d_net.diff,455 bytes, patch)
2004-01-14 13:35 UTC, Luke Maurer (Jyrinx)
Details | Diff
ifupdown proof of concept (ifupdown.tgz,2.47 KB, application/x-compressed-tar)
2004-07-23 02:02 UTC, Jörg Hoh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke Maurer (Jyrinx) 2004-01-14 13:33:06 UTC
I believe this would be a good, simple solution for the old where-to-configure-my-wireless-card-before-ifconfigging question. The patch simply adds a "preifup_$IFACE" option to /etc/conf.d/net, specifying an executable to be run immediately before any ifconfig calls. In my personal use case (a common one, I expect, judging by forum traffic concerning wireless), I just need to run a quick iwconfig script before dhcpcd is called for the wireless interface.

(Another nice thing is that this offers an obvious, simple way for people to add more complicated scripts that, for instance, configure differently for different ESSIDs, etc.)

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 1 Luke Maurer (Jyrinx) 2004-01-14 13:34:37 UTC
Created attachment 23817 [details, diff]
Modified net.eth0 to run script before ifconfig step
Comment 2 Luke Maurer (Jyrinx) 2004-01-14 13:35:52 UTC
Created attachment 23818 [details, diff]
New /etc/conf.d/net with comments on new preifup option
Comment 3 Seemant Kulleen (RETIRED) gentoo-dev 2004-01-14 15:31:02 UTC
speaking of which, jay :P
Comment 4 Roy Marples (RETIRED) gentoo-dev 2004-04-30 04:02:04 UTC
Someone close this bug as net.eth0 in baselayout >= 1.8.8 has this functionality by allowing custom preup() and predown() functions
Comment 5 Aron Griffis (RETIRED) gentoo-dev 2004-04-30 09:01:08 UTC
Yep
Comment 6 SpanKY gentoo-dev 2004-06-02 11:23:03 UTC
*** Bug 52763 has been marked as a duplicate of this bug. ***
Comment 7 Jörg Hoh 2004-07-23 02:02:23 UTC
Created attachment 35994 [details]
ifupdown proof of concept

I've created a small python script, which imitates the debian ifup/ifdown
mechanism and is more flexible than the current shellscript. 

This script is more a proof of concept than a ready-to-ship tool. At the moment
it lacks a proper error handling, pre-up and post-down scripting mechanisms and
a proper handling of other kind of devices (pppoe, plip, ...). It relies
heavily on /sbin/ip, which does the real work (setting addresses, routes,
bringing devices up and down).

The tgz includes a small example of the configuration file, which illustrates
the possibilites of ifup/ifdown. Note: make ifdown a link to ifup