inotifywait는 제거 이벤트를 인쇄하지 않습니다.

inotifywait는 제거 이벤트를 인쇄하지 않습니다.

매뉴얼 페이지에서 inotifywait:

EVENTS
...
       unmount
              The filesystem on which a watched file or directory resides was unmounted.
              After this event the file or directory is no longer being watched.  Note
              that this event can occur even if it is not explicitly being listened to.

나는 그것을 작동시키려고 노력하고 있지만 성공하지 못했습니다. watch 디렉토리를 언로드한 후에도 프로그램은 계속 실행되고 아무것도 인쇄되지 않습니다.

테스트 준비:

cd /tmp/
fallocate -l500M test.img
mkdir -p /media/test
losetup -f test.img
mkfs.ext4 /dev/loop0
mount /dev/loop0 /media/test
inotifywait -m /media/test &
inotifywait -m /media &

다른 이벤트가 작동하는지 테스트합니다.

[root@basinsrv tmp]# touch /media/test/xxx
/media/test/ CREATE xxx
/media/test/ OPEN xxx
/media/test/ ATTRIB xxx
/media/test/ CLOSE_WRITE,CLOSE xxx
[root@basinsrv tmp]#

제거:

[root@basinsrv tmp]# umount /media/test
[root@basinsrv tmp]#

내 시스템:

[root@basinsrv tmp]# uname -a
Linux basinsrv 3.10.0-957.10.1.el7.x86_64 #1 SMP Mon Mar 18 15:06:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@basinsrv tmp]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)

관련 정보