#!/bin/bash i=0 while [ $i -lt 1000 ];do i=$((i+1)) echo -n "$i: " tail -f /etc/hosts >/dev/null & pid=$! sleep 1 kill $pid done
Running it gives this result: [...] 65: /tmp/t.sh: line 11: 17838 Terminated tail -f /etc/hosts > /dev/null 66: /tmp/t.sh: line 11: 17840 Terminated tail -f /etc/hosts > /dev/null 67: /tmp/t.sh: line 11: 17842 Terminated tail -f /etc/hosts > /dev/null 68: tail: inotify cannot be used, reverting to polling: Too many open files /tmp/t.sh: line 11: 17844 Terminated tail -f /etc/hosts > /dev/null 69: tail: inotify cannot be used, reverting to polling: Too many open files /tmp/t.sh: line 11: 17847 Terminated tail -f /etc/hosts > /dev/null 70: tail: inotify cannot be used, reverting to polling: Too many open files /tmp/t.sh: line 11: 17850 Terminated tail -f /etc/hosts > /dev/null 71: tail: inotify cannot be used, reverting to polling: Too many open files ^C -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1101666 Title: inotify fd leak To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1101666/+subscriptions -- ubuntu-bugs mailing list [email protected] https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
