Samba, macOS and Spotlight: Possible on FreeBSD?

ulzeraj

Member

Reaction score: 16
Messages: 27

Agreed its yucky stuff but the results of having an indexed file server are kinda awesome. Not only names but file contents, music tags etc. I wouldn't dare to try it if not for the isolation of a jail and a previous dataset snapshot.

Installing devel/dconf fixes the issue about not saving the settings. I could run tracker-miner-fs and index my files.

Code:
root@file:/ # dbus-launch --csh-syntax > .dbus_settings
root@file:/ # setenv TRACKER_BUS_TYPE system
root@file:/ # source .dbus_settings
root@file:/ # gsettings set org.freedesktop.Tracker.Miner.Files index-recursive-directories "['/tank/srv', '/tank/pkg', '/Users']"
root@file:/ # /usr/local/libexec/tracker-miner-fs
fstab: /etc/fstab:0: No such file or directory
(tracker-miner-fs:20642): Tracker-CRITICAL **: Could not initialize the HAL context, no error, is hald running?
(tracker-miner-fs:20642): Tracker-WARNING **: Locale '0' is not set, defaulting to C locale
(tracker-miner-fs:20642): Tracker-WARNING **: Monitor backend:'GKqueueFileMonitor' is unknown, we have no limits in place because we don't know what we are dealing with!
It is a daemon so it will run until you press CTRL+C. You can start this daemon along with his many friends with " tracker control -s".

And it works! For some reason not everything I search for is indexed. It doesn't seem to be checking music metadata and other related stuff but I can find most file and foldernames and probably file types. In any case the results in finder do match the same results I get with the tracker search tool.

Code:
root@file:~ # tracker search -d Texhnolyze
(tracker search:33529): Tracker-WARNING **: Locale '0' is not set, defaulting to C locale

Results:

cols:4

  file:///tank/srv/mov/anime/Texhnolyze

    inode/directory

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder

  Texhnolyze


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2001.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 01.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2002.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 02.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2003.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 03.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2004.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 04.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2005.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 05.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2006.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 06.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2007.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 07.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2008.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 08.mkv


cols:4

  file:///tank/srv/mov/anime/Texhnolyze/Season%201/Texhnolyze%20-%2009.mkv

    video/x-matroska

    http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject

  Texhnolyze - 09.mkv



  ...


NOTE: Limit was reached, there are more items in the database not listed here



Still I don't know what to make of this mess. Tomorrow I will probably check how to make a clean install of everything. But the thing is the wiki guide actually works and the only thing missing from there (or as a dependency to net/samba47 with spotlight enabled) is dconf. Its also missing information about how to start the miner processes.
 

Snurg

Aspiring Daemon

Reaction score: 330
Messages: 794

Cool!
Congrats!
You found it!

I guess the others will be happy to verify the solution :)
 

ulzeraj

Member

Reaction score: 16
Messages: 27

Yay! Thanks for the help. I will consider reverting the jail to a previous snapshot and start again making a small howto in the process. I will leave it as it is for a while to check if it won't explode and make holes on the carpet.
 

Khaine

Member

Reaction score: 4
Messages: 56

It would be great if you did that. I use Samba at home to share stuff between my Macs, and while I don'u use spotlight that often this would be a nice addition to make using samba more seamless.
 

bsandor

New Member


Messages: 1

Has anyone written a simple how-to on getting Spotlight running on FreeBSD? It looks like you guys did a lot of hard work getting it going, and I was selfishly hoping to take advantage of your hard work as easily as possible ;-)

I, too, support many clients with MacOS clients and am hoping to replace their Mac servers with FreeNAS machines. It's very disappointing to see the lack of server support coming from Apple. I've been using FreeNAS for several years internally as a large file server, but Spotlight search is a necessity for my Mac clients.
 
Top