Cheat Sheets

System - sysctl Settings

Description

sysctl settings should be applied and persistent. That means all settings in /etc/sysctl.conf /etc/sysctl.d/*.conf must be active. This is important because network settings are not safely applied in Debian Squeeze by the procps script (running to early in the boot order).

Solution

/sbin/sysctl -p

Check Script: system-sysctl-settings.sh

#!/bin/bash

all=$(/sbin/sysctl -a 2>/dev/null) results=$( while read -r m; do printf "%s\n" "$all" | grep -q "$m" done < <( /bin/egrep -vh "^ *#|^ *$" /etc/sysctl.conf /etc/sysctl.d/*.conf 2>/dev/null | sed "s/ *= */ = /" 2>/dev/null ) | grep -v '^$' )

if [ "$results" == "" ]; then result_ok else result_failed "The following sysctl settings are not active: $results" fi
Comment on Disqus