dictd

From Gentoo Wiki
Jump to:navigation Jump to:search

dictd is a server implementing the DICT protocol, allowing clients to search dictionaries.

Installation

USE flags

USE flags for app-text/dictd Dictionary Client/Server for the DICT protocol

dbi Enable dev-db/libdbi (database-independent abstraction layer) support
judy Build Judy-based (dev-libs/judy) plugin implementing fast "exact" and especially "lev" strategies
minimal Don't build server but dict client, dictzip and dictfmt only.
selinux !!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur
test Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently)

Emerge

Install app-text/dictd:

root #emerge --ask app-text/dictd

Dictionaries

At least one dictd dictionary package must be installed before starting the server. Dictionaries in the dict format can be found in the app-dicts category with the prefixes dictd- and freedict-.

The WordNet dictionary is available as app-dicts/dictd-wn.

Other dictd dictionary packages are available on GURU. The app-dicts/dictd-meta package installs the following packages:

A thesaurus is also available on GURU: app-dicts/dictd-moby-thesaurus.

The freedict packages install .tar.gz files available on SourceForge; additional FreeDict dictionaries, in .tar.xz format, are available for downloading from freedict.org. To install one of these dictionaries, run:

root #tar -xvJf <name>.xz -C /usr/share/dict/ --strip-components=1 --exclude=COPYING

and then restart the dictd service.

Configuration

Server configuration

/etc/dict/dict.conf lists dictionary servers, one per line. By default, it contains:

FILE /etc/dict/dict.conf
# This is the configuration file for dict.
# Usually all you will ever need here is the server keywords.
# Refer to the dict manpage for other options.
# It will only check the second server if the first fails
server localhost
server dict.org

Refer to the dict(1) man page for possible configuration options.

/etc/dict/dictd.conf configures individual dictionaries; refer to dictd(8) for possible configuration options. On OpenRC systems, this file should not need to be edited manually - even if installing new dictionaries manually rather than via a package, the new dictionaries should be configured by the service script automatically upon (re-)starting.

Service

OpenRC

Add the service to the default runlevel:

root #rc-update add dictd default

Start the service:

root #rc-service dictd start

If additional dictionaries are added, be sure to restart the service:

root #rc-service dictd restart

systemd

To have the dictd daemon start when the system starts:

root #systemctl enable dictd.service

To start the dictd daemon immediately:

root #systemctl start dictd.service

To check if the service has started:

root #systemctl status dictd.service

To restart the service:

root #systemctl restart dictd.service

Clients

The app-text/dictd package provides the dict(1) client, but other clients include app-dicts/gnome-dictionary, xfce-extra/xfce4-dict, and dictionary.el in app-editors/emacs 28 and later.