return 0
}
+# Apply sysctl settings, including files in /etc/sysctl.d
+apply_sysctl() {
+ if [ -x /lib/systemd/systemd-sysctl ]; then
+ /lib/systemd/systemd-sysctl
+ return
+ fi
+
+ local file
+ for file in /usr/lib/sysctl.d/*.conf; do
+ [ -f /run/sysctl.d/${file##*/} ] && continue
+ [ -f /etc/sysctl.d/${file##*/} ] && continue
+ test -f "$file" && sysctl -q -e -p "$file"
+ done
+ for file in /run/sysctl.d/*.conf; do
+ [ -f /etc/sysctl.d/${file##*/} ] && continue
+ test -f "$file" && sysctl -q -e -p "$file"
+ done
+ for file in /etc/sysctl.d/*.conf; do
+ test -f "$file" && sysctl -q -e -p "$file"
+ done
+ sysctl -q -e -p /etc/sysctl.conf
+}
+
if is_yes "$FASTRC" || is_yes "$IN_SHUTDOWN"; then
RC_LOGGING=no
fi
# Modprobe needed devices
modprobe_net
+ # load sysctl params
+ apply_sysctl
+
# Setup interfaces names
if ! is_empty_file /etc/mactab && [ -x /sbin/nameif ]; then
run_cmd "Setting interfaces names (nameif)" /sbin/nameif
}
network_postinit() {
+ # Run this again to catch any interface-specific actions
+ apply_sysctl
+
# Set static RARP table
static_rarp
fi
# Early sysctls
- sysctl -q -e -p /etc/sysctl.conf
+ apply_sysctl
# sysfs is also needed before any other things (under kernel > 2.5)
if ! is_fsmounted sysfs /sys; then
/sbin/blogd
fi
- # Configure Linux kernel (initial configuration, some required modules still
- # may be missing).
- sysctl -q -e -p /etc/sysctl.conf
+ # Configure Linux kernel (initial configuration, some required modules still may be missing).
+ apply_sysctl
# Check if timezone definition is available
if [ -e /etc/localtime ] && [ -e /dev/rtc -o -e /dev/rtc0 ] ; then
fi
# ... and here finish configuring parameters
- sysctl -q -e -p /etc/sysctl.conf
+ apply_sysctl
else
emit --no-wait root-filesystem
emit --no-wait virtual-filesystems
# for mplayer
#dev.rtc.max-user-freq = 1024
#
-
-# protect hard/symlins
-fs.protected_hardlinks = 1
-fs.protected_symlinks = 1