[PATCHSET] Add OS X Spotlight support (was: Spotlight support)

Jeremy Allison jra at samba.org
Mon Aug 4 10:39:37 MDT 2014


On Fri, Aug 01, 2014 at 02:27:45PM +0200, Ralph Böhme wrote:
> Hi
> 
> On Wed, Apr 16, 2014 at 02:31:44PM -0700, Jeremy Allison wrote:
> > On Thu, Apr 10, 2014 at 01:42:48PM +0200, Ralph Böhme wrote:
> > > For all interested in Samba supporting Spotlight for OS X clients:
> > > 
> > > <https://github.com/slowfranklin/samba/commits/spotlight>
> > > 
> > > is already working as far as correctly replying to queries from
> > > clients. \o/
> > > 
> > > Samba acts as a proxy fowarding search queries to Gnome Tracker after
> > > mapping Apple's Spotlight query language to SPARQL.
> > > 
> > > IPC between Samba and the Tracker store is done via dbus in the
> > > relevant tracker library (libtracker-sparql). As all but the very
> > > latest Tracker version register services in DBUS user context, I have
> > > to use a bit of a hack in order to
> > > 
> > > - run Tracker in root DBUS user context
> > > 
> > > - pair every call to tracker in Samba within
> > >   become_root()/unbecome_root()
> > > 
> > > Latest Tracker 1.0 adds support for registering Tracker in DBUS system
> > > context, which will allow for a cleaner integration in the future.
> > > 
> > > Usage:
> > > 
> > > - install tracker and libtracker-sparql-dev (or whatever it's called
> > >   on your system)
> > > 
> > > - use a script like the following for starting Samba and a "private"
> > >   dbus instance: <https://gist.github.com/slowfranklin/10371423>
> > > 
> > > - install a dbus-session.conf file in the location referenced in the
> > >   start script and adust path in listen directive:
> > >   <https://gist.github.com/slowfranklin/8a52c36be3b6579f62ab>
> > >   
> > > - configure samba with --enable-spotlight
> > > 
> > > Comments welcome :-)
> > 
> > So I'd love to see you finish this up and send
> > it as a patchset to samba-technical for formal
> > review.
> 
> Here we go... final patches attached. For those who prefer a git repo:
> <https://github.com/slowfranklin/samba/commits/spotlight>
> 
> It's now fully async. The async tracker-sparql API uses a glib event
> loop with threads. That means, on occasion whenever I'm want to check
> whether any queued request is finished, I have to iteratate the glib
> event loop. This is done without blocking by using
> g_main_context_iteration().
> 
> Seems to work without unwanted side effects. Question to the threading
> experts: do you see any unwanted possible side effects here by going
> in bed with glib?
> 
> I'm not forcing DBUS IPC anymore with libtracker-sparql which means
> the library uses the so called direct backend: the database files are
> mmaped into the process address space. This got me rid of the
> become_root() calls.
> 
> Review appreciated. I would love to see this hit 4.2. :)

Woo hoo ! Great work - thanks ! I'll put this in my
review queue (*) and get to it asap.

Jeremy.

(*) it's really sad I now have to refer to my 'review queue' :-).


More information about the samba-technical mailing list