From 13c5a4efdd53445e0d92d71d630402a2a20d689e Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 28 Feb 2011 16:56:40 -0500 Subject: Move sysctl.conf/sysctl.d handling to a function, call it where appropriate. (#593211, continued) --- rc.d/init.d/functions | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rc.d/init.d/functions') diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 17df7382..8df93d06 100644 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -604,6 +604,15 @@ is_false() { return 1 } +# Apply sysctl settings, including files in /etc/sysctl.d +apply_sysctl() { + sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1 + for file in /etc/sysctl.d/* ; do + is_ignored_file "$file" && continue + test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1 + done +} + key_is_random() { [ "$1" = "/dev/urandom" -o "$1" = "/dev/hw_random" \ -o "$1" = "/dev/random" ] -- cgit v1.2.1