aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-03-25 18:43:30 +0000
committerJo-Philipp Wich <jow@openwrt.org>2013-03-25 18:43:30 +0000
commit08fd7e4663bd3acaef8c1ffc24abd6dbef28414b (patch)
tree4d7fab32a4374498605e742d2ac0a51c51769a10
parentd1d59cf7e0ec61784d1e3e0629f10cecc9bd2d30 (diff)
downloadupstream-08fd7e4663bd3acaef8c1ffc24abd6dbef28414b.tar.gz
upstream-08fd7e4663bd3acaef8c1ffc24abd6dbef28414b.tar.bz2
upstream-08fd7e4663bd3acaef8c1ffc24abd6dbef28414b.zip
package/base-files: change sysctl handling
Move /etc/init.d/sysctl to index 00 and add hotplug script that applies interface specific sysctls for interfaces that only appear later - this allows to reliably configure per-interface parameters in sysctl.conf, e.g. to disable ipv6 autoconfig on a specific iface. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@36129 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--package/base-files/Makefile2
-rw-r--r--package/base-files/files/etc/hotplug.d/net/00-sysctl6
-rwxr-xr-xpackage/base-files/files/etc/init.d/sysctl2
3 files changed, 8 insertions, 2 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index fcc24e5282..acd5e2e198 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=base-files
-PKG_RELEASE:=136
+PKG_RELEASE:=137
PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
PKG_BUILD_DEPENDS:=opkg/host
diff --git a/package/base-files/files/etc/hotplug.d/net/00-sysctl b/package/base-files/files/etc/hotplug.d/net/00-sysctl
new file mode 100644
index 0000000000..5d9da8ac06
--- /dev/null
+++ b/package/base-files/files/etc/hotplug.d/net/00-sysctl
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if [ -f /etc/sysctl.conf ] && [ "$ACTION" = add ]; then
+ sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" /etc/sysctl.conf | \
+ sysctl -e -p - | logger -t sysctl
+fi
diff --git a/package/base-files/files/etc/init.d/sysctl b/package/base-files/files/etc/init.d/sysctl
index 2397790555..beeb79f7e6 100755
--- a/package/base-files/files/etc/init.d/sysctl
+++ b/package/base-files/files/etc/init.d/sysctl
@@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
-START=99
+START=0
start() {
[ -f /etc/sysctl.conf ] && sysctl -p -e >&-
}