Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get xnotify to do anything ... #2

Open
ahmgithubahm opened this issue May 10, 2020 · 12 comments
Open

Can't get xnotify to do anything ... #2

ahmgithubahm opened this issue May 10, 2020 · 12 comments

Comments

@ahmgithubahm
Copy link

I'm sure I must be missing something:

ak@rhino:~$ pwd
/home/ak
ak@rhino:~$ which xnotify
/usr/local/bin/xnotify
ak@rhino:~$ file /usr/local/bin/xnotify
/usr/local/bin/xnotify: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
ak@rhino:~$ xnotify --version
xnotify version 0.2.2
ak@rhino:~$ xnotify --include '.'

Then in another window:

ak@rhino:~$ pwd
/home/ak
ak@rhino:~$ touch testfile
ak@rhino:~$ rm testfile

but I get nothing from xnotify. This is a physical Ubuntu 18.04 (5.3.0-51) AMD64 server. Running with --verbose shows me a great list of everything it's going to watch under /home/ak, but nothing else, and nothing when I touch and then rm a file.

How can I help diagnose, or what am I doing wrong ? Thanks in advance.

@AgentCosmic
Copy link
Owner

When you run the command with --verbose does it print the new file?

For example, after touch test.txt, here's what I get:

...
[xnotify] Watching: /home/vagrant/apps/dev/server/autorun/.git/COMMIT_EDITMSG
[xnotify] Watching: /home/vagrant/apps/dev/server/autorun/.git/HEAD
write test.txt

It might also be possible that you're watching too many files. So try it in a folder with fewer files. https://support.code42.com/CrashPlan/6/Troubleshooting/Linux_real-time_file_watching_errors

@ahmgithubahm
Copy link
Author

Hi and thanks for the reply.

Nope, with --verbose, I do not get anything apart from the initial list of what it is watching ([xnotify] Watching: ...). That list only contains 584 files, so I hope that isn't above a limit. 😄

$ cat /proc/sys/fs/inotify/max_user_watches
8192

Seems normal.

@AgentCosmic
Copy link
Owner

@ahmgithubahm
Copy link
Author

Hi. Yep, it seems to:

ak@rhino:~$ inotifywait -m /home/ak/
Setting up watches.
Watches established.
/home/ak/ OPEN,ISDIR
/home/ak/ ACCESS,ISDIR
/home/ak/ ACCESS,ISDIR
/home/ak/ CLOSE_NOWRITE,CLOSE,ISDIR
/home/ak/ CREATE jhdks
/home/ak/ OPEN jhdks
/home/ak/ ATTRIB jhdks
/home/ak/ CLOSE_WRITE,CLOSE jhdks
/home/ak/ DELETE jhdks

The output was while I ran an ls, a touch and them an rm in my home dir.

thanks

@AgentCosmic
Copy link
Owner

I'm not sure what's causing the problem. I updated fsnotify to the latest version. Let me know if it works. https://github.com/AgentCosmic/xnotify/releases/tag/v0.2.3

@floodico
Copy link

floodico commented Oct 8, 2020

Hi there! I have the same problem.
It worked for the first few minutes and then just stopped working.
OS: MacOS Catalina 10.15.4

@AgentCosmic
Copy link
Owner

Hi, is it the same exact error? It is v0.2.4?

@floodico
Copy link

floodico commented Oct 8, 2020

Hi, is it the same exact error? It is v0.2.4?

yes. I don't get any logs if i drop the files to the current directory. Only these logs were printed from time to time:

⇒  xnotify --client "55.55.55.5:8090" -i .
write .DS_Store
write .DS_Store

@AgentCosmic
Copy link
Owner

xnotify can only watch existing files. You can use --verbose to get more detailed logging.

@floodico
Copy link

floodico commented Oct 9, 2020

Ok, i get that at the start.
Screenshot 2020-10-09 at 11 41 36
And after that just nothing was printed.

xnotify can only watch existing files

So xnotify is not my option if i want to have event notifications about moving or copying files?

@AgentCosmic
Copy link
Owner

We'll it depends. On Windows it will detect if I create new file with my editor or if I drop a file in explorer. But when I use explorer to create new file it doesn't detect. This just uses whatever the library (fsnotify) and OS provides. Maybe you can try using the cli to move the file and see if it triggers?

@floodico
Copy link

floodico commented Oct 9, 2020

Actually fsnotify events work strange on VM system in my case. Maybe it works like this because of SSHFS synced folder.
My colleague described this situation in more detail here - adrienkohlbecker/vagrant-fsnotify#33.
So i thought that using xnotfy is the good solution to avoid 'incorrect' or 'not concrete' events of fsnotify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants