Add arvbox check for fs.inotify.max_user_watches, refs #21349
[arvados.git] / tools / arvbox / bin / arvbox
index b7c176af45715d7c232cfd34937e54990f506535..13583ba288eeae87d580bbafa577365bb38deafd 100755 (executable)
@@ -416,6 +416,14 @@ check() {
             exit 1
         ;;
     esac
+
+    user_watches=$(/usr/sbin/sysctl fs.inotify.max_user_watches)
+    [[ $user_watches =~ fs.inotify.max_user_watches\ =\ ([0-9]+) ]] && value=${BASH_REMATCH[1]}
+    if [[ "$value" -lt 256000 ]] ; then
+       echo "Not enough file system listeners ($value), to fix this run:"
+       echo "sudo sh -c 'echo fs.inotify.max_user_watches=524288 >> /etc/sysctl.d/local.conf && sysctl --system'"
+       exit 1
+    fi
 }
 
 subcmd="$1"