aboutsummaryrefslogtreecommitdiff
path: root/init.d
Commit message (Collapse)AuthorAgeFilesLines
* Allow setting blackhole-like routesAlexander Zubkov2024-05-231-3/+10
| | | | | | | | | | | | | | | | | | | | | There were several problems preventing usage of routes of types blackhole, prohibit, throw, unreachable in IFACE_routes variables: - Those route types do not allow to use dev in the route definition, but it was added unconditionally - As there is no dev, such routes are not flushed automatically by dev, they need to be remembered and deleted while stopping the interface - Route type must go before the prefix in the command, but first parameters have special meaning Signed-off-by: Alexander Zubkov <green@qrator.net> Closes: https://bugs.gentoo.org/637394 Closes: https://github.com/gentoo/netifrc/pull/53 X-Gentoo-Bug: 637394 X-Gentoo-Bug-URL: https://bugs.gentoo.org/637394 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
* net.lo.in: replace "type" bashism with "command"Matoro Mahri2024-01-071-1/+1
| | | | | | | Closes: https://bugs.gentoo.org/844178 Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> Closes: https://github.com/gentoo/netifrc/pull/50 Signed-off-by: Sam James <sam@gentoo.org>
* net.lo.in: quote variables in _configure_variablesPatrick McLean2021-03-301-2/+2
| | | | | | | The variables being passed to eval aren't quoted either in the before-eval scope, or in what is passed to eval. Make sure they are quoted. Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
* net/iproute2.sh: Add initial support for network namespacesPatrick McLean2021-03-111-0/+6
| | | | | | | | | | | | | | | | | | This adds initial support for network namespaces. An interface can be assigned to a network namespace with `netns_${IFACE}`. The script will move the interface to the namespace if it is not already there. This adds a helper functions to `functions.sh` called `_netns`, this function facilitates scripts working withing network namespaces. It allows eching to sysfs etc files, globbing, and arbitrary commands within a network namespace. This uses a wrapper for the `ip` command so all calls to it will add `-n ${netns}` so it's operating in the netns. Basic interface configuration is tested and working. Signed-off-by: Patrick McLean <chutzpah@gentoo.org> Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
* init.d/net.lo.in: Add missing closing function bracketLars Wendler2020-09-071-0/+1
| | | | | | Bug introdcued with commit d3b5d78c5f3696aaf841d7900e69a37de29cfc25 Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
* dhclientv6: Add DHCPv6 support via dhclientDaniel Solano Gómez2020-06-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds DHCPv6 support to OpenRC in Linux using dhclient as outlined by Stuart Longland at <http://stuartl.longlandclan.yi.org/blog/2011/02/15/gentoo-and-dhcpv6/>. The main place where the new support is added is via a modified copy of the dhclient.sh script that: - Renames functions using a 'v6' suffix - Uses a different pid file - Uses the '-6' argument when invoking dhclient - Recognizes new DHCPv6-specific configuration variables with a fallback to the DHCP configuration variables. Additionally: 1. The iproute2 and Linux ifconfig scripts have been ammended to be able to return IPv6 addresses using new '_get_inet6_address' and '_get_inet6_addresses' functions. 2. The 'net.lo' init script now has a '_show_address6' function. 3. The documentation in the Linux net.example now contains some DHCPv6 information. Reported-by: Dustin C. Hatch <admiralnemo@gmail.com> X-Gentoo-Bug: 150908 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=150908 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> (cherry picked from commit bd7bd3a513c8ddc554e211316c990b5f98110982) Closes: https://bugs.gentoo.org/450326 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: stop()Robin H. Johnson2019-04-201-4/+6
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: start()Robin H. Johnson2019-04-201-11/+19
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: _run_if()Robin H. Johnson2019-04-201-1/+1
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: _load_configRobin H. Johnson2019-04-201-4/+5
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: _load_modulesRobin H. Johnson2019-04-201-6/+8
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: PROVIDEDBY MODULE trampleRobin H. Johnson2019-04-201-5/+5
| | | | | | | This is a logic error caught by shellcheck. The nested loops used the same index variable, so the outer loop progress could get trampled. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: _gen_module_list()Robin H. Johnson2019-04-201-12/+12
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: _which()Robin H. Johnson2019-04-201-1/+1
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: quick initial variable valuesRobin H. Johnson2019-04-201-2/+2
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: arraysRobin H. Johnson2019-04-201-3/+3
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: depend()Robin H. Johnson2019-04-201-6/+7
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: toplevel INIT variableRobin H. Johnson2019-04-201-1/+1
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: disable some false positivesRobin H. Johnson2019-04-201-0/+6
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo.in: shellcheck: _gen_module_list(), _load_modules()Robin H. Johnson2019-04-201-0/+6
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Add shellcheck toolingRobin H. Johnson2019-04-201-0/+1
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo: add a configurable presence timeoutMaciej S. Szmigiero2018-07-111-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | Sometimes one may want to wait for a particular interface to show up when starting its service. For example if a "net.foo" service is in the "default" runlevel so it provides (or co-provides) the "net" service and it takes a while for the "foo" interface to initialize and show up in the system during boot this interface initialization will race with starting of this "net.foo" service by the service manager - if the interface hasn't shown up yet the service won't be able to start (and so will services that depend on it). This setting specifies how long we'll wait for an interface to show up in this case (in seconds). For backward-compatibility the default is 0 (don't wait at all) - this matches the existing behavior of netifrc, so existing deployments aren't affected by this change. This new setting is similar to an already present "wait for carrier timeout" setting. Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> (cherry picked from commit 64f33a2032b4972a25cad6405678f678a5a269ff) Closes: https://github.com/gentoo/netifrc/pull/28
* init.d/net.lo: atomically create moduleslist.Robin H. Johnson2017-11-141-7/+10
| | | | | Bug: https://bugs.gentoo.org/637474 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* init.d/net.lo: per-iface moduleslistHagbard Celine2017-11-141-1/+4
| | | | | | | | Avoid race conditions in generation of modules list (nettree), and allow per-interface custom module work more easily. Closes: https://bugs.gentoo.org/637474 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* net.lo: Add metric to supported config variablesSven Wegener2016-10-241-1/+1
| | | | | | | This allows us to use metric_<SSID> for configuration. Signed-off-by: Sven Wegener <swegener@gentoo.org> (cherry picked from commit 3cd367c958e533bbeae011699eef0da2fdf1079e)
* net.lo: do not hide any _add_route output.Robin H. Johnson2016-10-231-1/+1
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* net.lo: display ALL routesRobin H. Johnson2016-10-231-8/+2
| | | | | | | | | For historical reasons, we used to suppress the first route for an interface, but this make it unclear what was being done. Display all routes instead. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* iproute2: clean up error output and make sure it works.Robin H. Johnson2016-10-231-1/+3
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* net.lo: framework for error handling customization.Robin H. Johnson2016-10-231-0/+28
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* net.lo: use #!/sbin/openrc-run instead of #!/sbin/runscriptThomas Deutschmann2016-06-121-2/+2
| | | | See: https://bugs.gentoo.org/573846
* New functions: set/get/is_interface_type to persistently track type of ↵Robin H. Johnson2015-11-081-0/+12
| | | | | | interfaces despite conf.d/net changes. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* Update copyright on net.lo.in for significent gentoo changes.Robin H. Johnson2015-11-081-0/+1
| | | | Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* _wait_for_carrier(): Workaround for output when using rc_parallel="YES" is ↵Thomas D2015-03-101-6/+5
| | | | | | | | | | | | | | | no longer needed _wait_for_carrier() was using a workaround when rc_parallel is enabled. This caused the following broken output: https://bugs.gentoo.org/attachment.cgi?id=361054 This patch fixes bug 488256 by removing the workaround, because this workaround isn't needed anymore. X-Gentoo-Bug: 488256 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=488256
* lo should not have a "need" dependency on localmountPatrick McLean2015-01-281-1/+2
|
* Do not call exit with a negative valueMike Gilbert2015-01-151-1/+1
| | | | This is undefined in POSIX.
* Update runscript to use functions.sh compatibility layerRabi Shanker Guha2015-01-091-3/+15
|
* Fix https://bugs.gentoo.org/show_bug.cgi?id=500942mirabilos2014-10-111-1/+1
| | | | | | “unset x” also removes the “local x” property, so the next assignment and/or read to/from $x will access the global variable “x”. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
* net.lo: cached module list timing issueRobin H. Johnson2014-07-161-10/+14
| | | | | | | | | Handle cached modulelist being newer than current time, as it would not be recached even when needed; force recache. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Gentoo-Bug: 506966 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=506966
* Clarify the "no configuration specified" messageWilliam Hubbs2013-08-241-1/+1
| | | | | | | | | This is not quite correct. The part that is not specified is config_${IFVAR}. It is possible to configure an interface to use DHCP but not specify an address. X-Gentoo-Bug: 482364 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=482364
* init.d: rearrange MakefileWilliam Hubbs2013-04-091-3/+2
|
* initial commit ported from OpenRcWilliam Hubbs2013-04-063-0/+814