INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Auto Import -> CIFS/Samba/Shares  (Read 11202 times)

prahl

  • Recent member
  • *
  • Posts: 12
Auto Import -> CIFS/Samba/Shares
« on: April 14, 2015, 03:07:34 am »

Auto import for windows shares doesn't work.

I have written a program which mounts Windows shares to my Linux directory.
This directory is watched by the mediacenter (20.0.84).
After mounting my program triggers the import and it works fine.
(command: mount -v -t cifs "//IP/Path" "/mnt/Target" -o ro,uid=1000,guest)

But if I add new tracks to the Windows share, JRiver does not trigger the import automatically.
Do you have any ideas to solve this?

Things I already know:
- JRiver imports tracks every 2 hours
- There are no change notification for mounts with cifs, because of the VFS hooks.

Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5175
  • "Linux Merit Badge" Recipient
Re: Auto Import -> CIFS/Samba/Shares
« Reply #1 on: April 14, 2015, 07:39:15 am »

Without filesystem change notifications, autoimport will not work in real time.  It's designed to pick up filesystem events and just import the changed files, and then to re-run itself at fixed intervals to catch anything that fell through the cracks.  Without filesystem events there will be no real-time auto-import, but

- There are no change notification for mounts with cifs, because of the VFS hooks.

That's not the case.  My understanding is that Samba implemented filesystem notifications using inotify in Samba 3.6.2 (https://www.samba.org/samba/history/samba-3.6.2.html), with some refinements in samba 4.  What version of Samba are you running?

I use auto-import across cifs every day and get filesystem notification events.  Admittedly my daily usage is a windows machine running JRiver watching a cifs share hosted on a Linux box, not the other way around, but auto-import mostly "just works" for me which means I'm getting filesystem events from the Linux box regularly.  

So if you have an up to date Samba, something else is at issue here.  Maybe try mounting the shares read/write?  What distro/version are you running?  What OS is the computer hosting the shares?
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71382
  • Where did I put my teeth?
Re: Auto Import -> CIFS/Samba/Shares
« Reply #2 on: April 14, 2015, 09:16:11 am »

I believe that, for some drives, we use a timer, not just the OS events. 
Logged

prahl

  • Recent member
  • *
  • Posts: 12
Re: Auto Import -> CIFS/Samba/Shares
« Reply #3 on: April 17, 2015, 04:51:53 am »

The mediacenter 20.0.84 runs on a Debian 7.8 (wheezy).

I have tried mounting a windows 7 share and a share from Debian 7.8. with samba 3.6.6.

If I add a new track to my local library, auto-import is called.
But if I add a new track to one of both shares, auto-import is not called.

Mounting shares as read/write with mount.cifs didn't work.
(mount.cifs 5.5)
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Auto Import -> CIFS/Samba/Shares
« Reply #4 on: April 17, 2015, 10:45:47 am »

MC uses inotify events to catch filesystem changes so whatever you are using would have to support that.
If the filesystem doesn't support inotify (the add watch fails) then the watch folder will be scanned once every 2 hours.
Logged

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13488
Re: Auto Import -> CIFS/Samba/Shares
« Reply #5 on: May 06, 2016, 02:56:07 pm »

MC uses inotify events to catch filesystem changes so whatever you are using would have to support that.
If the filesystem doesn't support inotify (the add watch fails) then the watch folder will be scanned once every 2 hours.

So I've discovered that's not working properly since the inotify setup doesn't return an error. Unfortunately even though samba supports notify support it seems cifs mounts do not.
(several references to that on the net) and I've verified that it doesn't work. Will be in the pipeline for a fix...
Logged

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5175
  • "Linux Merit Badge" Recipient
Re: Auto Import -> CIFS/Samba/Shares
« Reply #6 on: May 06, 2016, 03:56:46 pm »

So I've discovered that's not working properly since the inotify setup doesn't return an error. Unfortunately even though samba supports notify support it seems cifs mounts do not.
(several references to that on the net) and I've verified that it doesn't work. Will be in the pipeline for a fix...

That would explain why inotify is triggering auto-import on Linux-hosted samba shares for my windows MC server, but not for OP's linux server.
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10712
Re: Auto Import -> CIFS/Samba/Shares
« Reply #7 on: May 07, 2016, 11:00:20 am »

Sounds like the VFS layer doesn't support this, sounds like something that won't be fixed on a OS level for years to come, unfortunate for cifs shares really.
Logged
~ nevcairiel
~ Author of LAV Filters
Pages: [1]   Go Up