Spotlight support

David Disseldorp ddiss at suse.de
Thu Apr 10 06:33:52 MDT 2014


Hi Ralph,

On Thu, 10 Apr 2014 13:42:48 +0200, Ralph Böhme wrote:

> Hi!
> 
> 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/

Great, nice work!

> Samba acts as a proxy fowarding search queries to Gnome Tracker after
> mapping Apple's Spotlight query language to SPARQL.

Oh, I naively thought that Spotlight made use of the Windows Search
Protocol (MS-WSP) to query the remote indexing service. Skimming through
the code it looks like a separate named pipe (mdssvc) is used, with
presumably a different protocol.  How does Apple's protocol differ?
Is it at all documented?

> 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 :-)

I'll take a closer look in the coming days. Just a comment from
skimming through: please avoid the macros added with
https://github.com/slowfranklin/samba/commit/49d75640a2c58f8c6b0a00aae6920be9f38c6678

They're generally frowned upon, as they affect control-flow (by jumping
a magic label), and also rely on externally defined variables.

Cheers, David


More information about the samba-technical mailing list