Browse code

Begin a section in the check-config script to check limits

Initially this checks the kernel's maxkeys setting which is
low in some older distribution kernels, such that only 200 containers
can be created, reported in #22865.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>

Justin Cormack authored on 2016/05/21 08:05:25
Showing 1 changed files
... ...
@@ -275,3 +275,16 @@ echo '- Storage Drivers:'
275 275
 } | sed 's/^/  /'
276 276
 echo
277 277
 
278
+check_limit_over()
279
+{
280
+	if [ $(cat "$1") -le "$2" ]; then
281
+		wrap_bad "- $1" "$(cat $1)"
282
+		wrap_color "    This should be set to at least $2, for example set: sysctl -w kernel/keys/root_maxkeys=1000000" bold black
283
+	else
284
+		wrap_good "- $1" "$(cat $1)"
285
+	fi
286
+}
287
+
288
+echo 'Limits:'
289
+check_limit_over /proc/sys/kernel/keys/root_maxkeys 10000
290
+echo