Skip to content

Commit

Permalink
Merge pull request #361 from simondeziel/max_user_watches
Browse files Browse the repository at this point in the history
snapcraft/commands/daemon.start: bump fs.inotify.max_user_watches
  • Loading branch information
tomponline committed Mar 20, 2024
2 parents 2287025 + 8db7324 commit 858cc3f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,13 @@ if [ "$(stat -c '%u' /proc)" = 0 ]; then
fi
fi

if [ -e /proc/sys/fs/inotify/max_user_watches ]; then
if [ "$(cat /proc/sys/fs/inotify/max_user_watches)" -lt "1048576" ]; then
echo "==> Increasing the number of inotify user watches"
echo 1048576 > /proc/sys/fs/inotify/max_user_watches || true
fi
fi

if [ -e /proc/sys/kernel/keys/maxkeys ]; then
if [ "$(cat /proc/sys/kernel/keys/maxkeys)" -lt "2000" ]; then
echo "==> Increasing the number of keys for a nonroot user"
Expand Down

0 comments on commit 858cc3f

Please sign in to comment.