Explorar o código

Merge pull request #22867 from justincormack/checklimits

Begin a section in the check-config script to check limits
Brian Goff %!s(int64=9) %!d(string=hai) anos
pai
achega
273ab8591e
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      contrib/check-config.sh

+ 13 - 0
contrib/check-config.sh

@@ -275,3 +275,16 @@ echo '- Storage Drivers:'
 } | sed 's/^/  /'
 echo
 
+check_limit_over()
+{
+	if [ $(cat "$1") -le "$2" ]; then
+		wrap_bad "- $1" "$(cat $1)"
+		wrap_color "    This should be set to at least $2, for example set: sysctl -w kernel/keys/root_maxkeys=1000000" bold black
+	else
+		wrap_good "- $1" "$(cat $1)"
+	fi
+}
+
+echo 'Limits:'
+check_limit_over /proc/sys/kernel/keys/root_maxkeys 10000
+echo