Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 376153 - Request: eselect module for managing /etc/init.d/net.* symlinks
Summary: Request: eselect module for managing /etc/init.d/net.* symlinks
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Gentoo eselect Team
Keywords: Inclusion
Depends on:
Reported: 2011-07-24 00:08 UTC by kahrl
Modified: 2011-07-26 10:41 UTC (History)
1 user (show)

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

eselect module suggestion, install to /usr/share/eselect/modules/net.eselect (net.eselect-1.0,5.44 KB, text/plain)
2011-07-24 00:11 UTC, kahrl
Ebuild for separate installation (eselect-net-1.0.ebuild,542 bytes, text/plain)
2011-07-24 00:12 UTC, kahrl

Note You need to log in before you can comment on or make changes to this bug.
Description kahrl 2011-07-24 00:08:09 UTC
I would like to see an eselect module that simplifies creating and deleting init scripts for network interfaces, /etc/init.d/net.*. Actually, creating/deleting these symlinks is simple enough, but (like rc.eselect, kernel.eselect and others) an eselect module coould show additional info and have some extra safeguards, for example to never delete /etc/init.d/net.lo and to ensure all created symlinks use a relative path.

I have attached my attempt at writing this module (this is my first eselect module, so beware). I'm not sure if "net" is a good name for this module, it might be too generic - other suggestions are welcome (perhaps it could even be merged into the rc module). There also is an ebuild for app-admin/eselect-net in case this doesn't end up in the base app-admin/eselect.

These are the features of the attached module:
- "add <interface>" action: adds a symlink from /etc/init.d/net.<interface> to net.lo.
- "delete <interface>" action: deletes /etc/init.d/net.<interface> if it is a symlink to net.lo. Prints a warning message if the init script is still in at least one runlevel.
- "list" action: shows a list of /etc/init.d/net.* init scripts and their respective runlevels.
- The parameter for "add" and "delete" can be optionally prefixed with "net.", so "add eth1" and "add net.eth1" do the same thing. "delete" also accepts numeric arguments that refer to the items printed by "list".
- If a parameter is lo, net.lo or its numeric equivalent, the scripts bails out with an error message ("add net.lo" actually checks if net.lo is a executable regular file and prints a different error message if this is not the case).

Reproducible: Always
Comment 1 kahrl 2011-07-24 00:11:22 UTC
Created attachment 280785 [details]
eselect module suggestion, install to /usr/share/eselect/modules/net.eselect
Comment 2 kahrl 2011-07-24 00:12:23 UTC
Created attachment 280787 [details]
Ebuild for separate installation