Spotlight: Difference between revisions

From SambaWiki
mNo edit summary
 
(59 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Introduction ==
== Introduction ==
This page is meant to give an overview about compiling and configuring Samba with support for OS X [http://en.wikipedia.org/wiki/Spotlight_(software) Spotlight] support.
This page is meant to give an overview about compiling and configuring Samba with support for macOS [http://en.wikipedia.org/wiki/Spotlight_(software) Spotlight] support.


Samba uses [https://wiki.gnome.org/Projects/Tracker Gnome Tracker] as search engine, search tool and metadata storage system.
Samba supports using either [https://www.elastic.co/products/elasticsearch Elasticsearch] or [https://wiki.gnome.org/Projects/Tracker Gnome Tracker] as search engine, search tool and metadata storage system.


See the following pages for details on how to set this up:
== Prerequisites ==
You need the following packages installed: '''tracker''' and '''libtracker-sparql-dev''', the exact name may be different on your system.


* [[Spotlight with Elasticsearch Backend]]
== Compiling ==
* [[Spotlight with Gnome Tracker Backend]]
Configure samba with --enable-spotlight:
<pre>
$ ./configure ... --enable-spotlight ...
...
Checking for tracker-sparql-1.0 : not found
Checking for tracker-sparql-0.16 : yes
Checking for header tracker-sparql.h : yes
Checking for library tracker-sparql-0.16 : yes
Checking for library glib-2.0 : yes
Checking for library gio-2.0 : yes
Checking for library gobject-2.0 : yes
building with Spotlight support
...
</pre>


The recommended backend for any kind of deployment is '''Elasticsearch'''.
== Running Samba ==
Tracker uses DBUS for IPC between Tracker processes and processes that want to run queries against the Tracker metadata store. Therefor you have to carefully start Samba, a dbus-daemon instance and Tracker ensuring all processes are then able to communicate with each other over the correct DBUS bus: [[Samba Spotlight Start Script]]. The magic that makes this work is the environment variable DBUS_SESSION_BUS_ADDRESS.

The dbus-daemon that is started from the script need its config file with a matching DBUS session address, here's an example: [[Spotlight DBUS Configuration File]].

Another point to keep in mind is the location where Tracker stores its config and database. Tracker was developed with a per-user use case in mind, as such configuration and data is put in locations relative to the users home directory of the uid of the Tracker processes. By changing the value of the HOME environment variable (a more fine grained approach is modifying the environment variables of the [https://developer.gnome.org/basedir-spec/ XDG basedir specification]).

== Configuring Tracker and using Tracker tools ==
In order to use Tracker commandline tools, you have to run a root shell and source these shell commands:
<pre>
# cat .tracker_env
INSTALLDIR=/some/dir
TRACKER_DIR="$INSTALLDIR/var/tracker"
export HOME="$TRACKER_DIR"
export DBUS_SESSION_BUS_ADDRESS="unix:path=$INSTALLDIR/var/run/spotlight.ipc"
# . .tracker_env
#
</pre>

Now you can tell Tracker which directories to index:
<pre>
# gsettings set org.freedesktop.Tracker.Miner.Files index-recursive-directories "['/Volumes/spotlight']"
</pre>

== Configuring Samba ==
You can the Spotlight RPC service '''mdssvc''' either as an smbd embedded service or by using the '''mdssd''' RPC daemon:

<pre>
[global]
....
rpc_server:mdssvc = embedded
....
</pre>

or
<pre>
[global]
....
rpc_daemon:mdssd = fork
rpc_server:mdssvc = external
....
</pre>

Finally enable Spotlight searching on a per share basis:
<pre>
[share]
path = /some/path
spotlight = yes
</pre>

Latest revision as of 09:13, 19 March 2020

Introduction

This page is meant to give an overview about compiling and configuring Samba with support for macOS Spotlight support.

Samba supports using either Elasticsearch or Gnome Tracker as search engine, search tool and metadata storage system.

See the following pages for details on how to set this up:

The recommended backend for any kind of deployment is Elasticsearch.